deep-rename-keys-ts
v1.0.1
Published
Recursively rename the keys in an object.
Downloads
535
Maintainers
Readme
deep-rename-keys
Recursively rename the keys in an object.
This is a port of the library deep-rename-keys to Typescript.
As the codebase itself is quite simple, and it's a combination of three other 1 function package, I just copied all of them into a single package removing the unnecesary codebase so we can have typings.
The only package I mantined was isobject
as it provides typings.
Install
Install with npm:
$ npm install --save deep-rename-keys-ts
Usage
import deepRename from 'deep-rename-keys-ts';
var obj = deepRename({a: {a: {a: 'b'}}}, (key) {
if (key === 'a') return 'zzz';
return key;
});
//=> {zzz: {zzz: {zzz: 'b'}}}
About
Related projects
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2017, Javier Bullrich. Released under the MIT License.