time-to-botec/js/node_modules/@stdlib/utils/uncapitalize-keys
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

uncapitalizeKeys

Convert the first letter of each object key to lowercase.

Usage

var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' );

uncapitalizeKeys( obj )

Converts the first letter of each object key to lowercase, mapping the transformed keys to a new object having the same values.

var obj1 = {
    'BeepBoop': 1,
    'FooBar': 2
};

var obj2 = uncapitalizeKeys( obj1 );
// returns { 'beepBoop': 1, 'fooBar': 2 }

Notes

  • The function only transforms own properties. Hence, the function does not transform inherited properties.
  • The function shallow copies key values.

Examples

var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' );

var obj1 = {
    'AA': 'beep',
    'BB': 'boop',
    'CC': 'foo',
    'DD': 'bar'
};

var obj2 = uncapitalizeKeys( obj1 );

console.dir( obj2 );
// => { 'aA': 'beep', 'bB': 'boop', 'cC': 'foo', 'dD': 'bar' }