deabsdeep
Recursively replace absolute paths in object keys and values or array values with a ~
.
Installation
npm install deabsdeep
Usage
const deabsDeep = ; // __dirname = /foo/bar ;/* =>{ '~/a.txt': { baz: '~/a.txt' }}*/ ;/* =>[ '~/a.txt', '~/a.txt']*/
Options
root
(default: project root)
A root folder, by default the project root folder (where your package.json
is) will be used:
;
mask
(default: ~
)
A string to replace the root folder with:
;
Jest serializer
Update your package.json
to make Jest replace all absolute paths in snapshots:
Change log
The change log can be found on the Releases page.
Contributing
Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.
Authors and license
Artem Sapegin and contributors.
MIT License, see the included License.md file.