Gathering detailed insights and metrics for camelcase-keys
Gathering detailed insights and metrics for camelcase-keys
Gathering detailed insights and metrics for camelcase-keys
Gathering detailed insights and metrics for camelcase-keys
@types/camelcase-keys-deep
TypeScript definitions for camelcase-keys-deep
camelcase-keys-recursive
Adaptation of camelcase-keys but recursive.
@rockyj/camelcase-keys
Largely forked from https://github.com/sindresorhus/camelcase-keys (Thank you!).
camelcase-keys-deep
Deeply convert the keys of an object to camelCase
npm install camelcase-keys
99
Supply Chain
99.5
Quality
76.9
Maintenance
100
Vulnerability
99.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
691 Stars
95 Commits
95 Forks
9 Watching
1 Branches
23 Contributors
Updated on 04 Nov 2024
Minified
Minified + Gzipped
TypeScript (63.32%)
JavaScript (36.68%)
Cumulative downloads
Total Downloads
Last day
-2.3%
3,628,742
Compared to previous day
Last week
4.3%
19,670,050
Compared to previous week
Last month
23.8%
76,720,642
Compared to previous month
Last year
-9.4%
804,530,952
Compared to previous year
Convert object keys to camel case using
camelcase
1npm install camelcase-keys
1import camelcaseKeys from 'camelcase-keys'; 2 3// Convert an object 4camelcaseKeys({'foo-bar': true}); 5//=> {fooBar: true} 6 7// Convert an array of objects 8camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]); 9//=> [{fooBar: true}, {barFoo: false}]
1import {parseArgs} from 'node:util'; 2import camelcaseKeys from 'camelcase-keys'; 3 4const commandLineArguments = parseArgs(); 5//=> {_: [], 'foo-bar': true} 6 7camelcaseKeys(commandLineArguments); 8//=> {_: [], fooBar: true}
Type: Record<string, unknown> | ReadonlyArray<Record<string, unknown>>
A plain object or array of plain objects to camel-case.
Type: object
Type: Array<string | RegExp>
Default: []
Exclude keys from being camel-cased.
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
1import camelcaseKeys from 'camelcase-keys'; 2 3const object = { 4 'foo-bar': true, 5 nested: { 6 unicorn_rainbow: true 7 } 8}; 9 10camelcaseKeys(object, {deep: true}); 11//=> {fooBar: true, nested: {unicornRainbow: true}} 12 13camelcaseKeys(object, {deep: false}); 14//=> {fooBar: true, nested: {unicorn_rainbow: true}}
Type: boolean
Default: false
Uppercase the first character: bye-bye
→ ByeBye
1import camelcaseKeys from 'camelcase-keys'; 2 3camelcaseKeys({'foo-bar': true}, {pascalCase: true}); 4//=> {FooBar: true} 5 6camelcaseKeys({'foo-bar': true}, {pascalCase: false}); 7//=> {fooBar: true}
Type: boolean
Default: false
Preserve consecutive uppercase characters: foo-BAR
→ FooBAR
1import camelcaseKeys from 'camelcase-keys'; 2 3camelcaseKeys({'foo-BAR': true}, {preserveConsecutiveUppercase: true}); 4//=> {fooBAR: true} 5 6camelcaseKeys({'foo-BAR': true}, {preserveConsecutiveUppercase: false}); 7//=> {fooBar: true}
Type: string[]
Default: []
Exclude children at the given object paths in dot-notation from being camel-cased.
For example, with an object like {a: {b: '🦄'}}
, the object path to reach the unicorn is 'a.b'
.
1import camelcaseKeys from 'camelcase-keys'; 2 3const object = { 4 a_b: 1, 5 a_c: { 6 c_d: 1, 7 c_e: { 8 e_f: 1 9 } 10 } 11}; 12 13camelcaseKeys(object, { 14 deep: true, 15 stopPaths: [ 16 'a_c.c_e' 17 ] 18}), 19/* 20{ 21 aB: 1, 22 aC: { 23 cD: 1, 24 cE: { 25 e_f: 1 26 } 27 } 28} 29*/
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/30 approved changesets -- score normalized to 4
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More