Last active
November 7, 2022 11:58
-
-
Save RobinKnipe/b3ae809180b0ed2c93b11b45e612dc32 to your computer and use it in GitHub Desktop.
Strip request/response and Sympol fields from a SuperAgent-style request/response object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const strip = obj => Object | |
| .fromEntries( | |
| Object | |
| .entries(obj) | |
| .filter(([k]) => !/^(?:_|[Rr]e[sq]|.*Symbol).*$/.test(k)) | |
| .map(([k, v]) => [k, v instanceof Object ? strip(v) : v]) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment