![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
decamelcase-keys
Advanced tools
Convert object keys from camelCase/PascalCase to snake_case or into a lowercased one with a custom separator.
Distinctive features from similar packages:
This project uses decamelize
and was made on the basis of camelcase-keys
npm i decamelcase-keys
const decamelcaseKeys = require('decamelcase-keys');
// Convert an object
decamelcaseKeys({fooBar: true});
//=> {foo_bar: true}
// Convert an array of objects
decamelcaseKeys([{fooBar: true}, {barFoo: false}]);
//=> [{foo_bar: true}, {bar_foo: false}]
// Recurse nested objects
decamelcaseKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
//=> {foo_bar: true, nested: {unicorn_rainbow: true}}
// Convert object keys with a custom separator (for example, in kebab case)
decamelcaseKeys({FooBar: true, Nested: {UnicornRainbow: true}}, {deep: true, separator: '-'});
//=> {'foo-bar': true, nested: {'unicorn-rainbow': true}}
// Exclude keys from being snake-cased
decamelcaseKeys({fooBar: true, barFoo: false}, {exclude: ['barFoo']});
//=> {foo_bar: true, barFoo: false}
// Exclude children at the given object paths
decamelcaseKeys({aB: 1, aC: {cD: 1, cE: {eF: 1}}}, {deep: true, stopPaths: ['aC.cE']});
//=> {a_b: 1, a_c: {c_d: 1, c_e: {eF: 1}}}
Type: object | object[]
An object or array of objects to snake-case.
Type: object
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
Type: string
Default: '_'
The separator to use to put in between the words.
Type: Array<string | RegExp>
Default: []
Exclude keys from being snake-cased.
Type: string[]
Default: []
Exclude children at the given object paths in dot-notation from being snake-cased. For example, with an object like {a: {b: '🦄'}}
, the object path to reach the unicorn is 'a.b'
.
decamelcaseKeys({
aB: 1,
aC: {
cD: 1,
cE: {
eF: 1
}
}
}, {
deep: true,
stopPaths: [
'aC.cE'
]
}),
/*
{
a_b: 1,
a_c: {
c_d: 1,
c_e: {
eF: 1
}
}
}
*/
See camelcase-keys
for the inverse.
decamelcase-keys
is MIT licensed.
FAQs
Convert object keys to snake case
The npm package decamelcase-keys receives a total of 208 weekly downloads. As such, decamelcase-keys popularity was classified as not popular.
We found that decamelcase-keys demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.