deep-rename-keys-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

deep-rename-keys

NPM version NPM monthly downloads NPM total downloads

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

  • isobject: Returns true if the value is an object and not an array or null. | homepage

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.

Package Sidebar

Install

npm i deep-rename-keys-ts

Weekly Downloads

220

Version

1.0.1

License

MIT

Unpacked Size

11.8 kB

Total Files

9

Last publish

Collaborators

  • javyer