Gathering detailed insights and metrics for @replygirl/change-case-object
Gathering detailed insights and metrics for @replygirl/change-case-object
Gathering detailed insights and metrics for @replygirl/change-case-object
Gathering detailed insights and metrics for @replygirl/change-case-object
npm install @replygirl/change-case-object
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
27 Commits
8 Branches
1 Contributors
Updated on 06 May 2022
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
34.5%
113
Compared to previous day
Last week
42.9%
410
Compared to previous week
Last month
18.4%
1,176
Compared to previous month
Last year
356.1%
14,143
Compared to previous year
1
2
Recursively change the case of an object's keys
1yarn add @replygirl/change-case-object
1import { /* function */ } from 'change-case-object'
camelCase
capitalCase
constantCase
dotCase
headerCase
noCase
paramCase
pascalCase
pathCase
sentenceCase
snakeCase
camelCase
1camelCase({ some_key: { some_other_key: true }) 2// { someKey: { someOtherKey: true }}
capitalCase
1capitalCase({ some_key: { some_other_key: true }) 2// { 'Some Key': { 'Some Other Key': true }}
constantCase
1constantCase({ some_key: { some_other_key: true }) 2// { SOME_KEY: { SOME_OTHER_KEY: true }}
dotCase
Why would you do this??
1dotCase({ some_key: { some_other_key: true }) 2// { 'some.key': { 'some.other.key': true }}
headerCase
1headerCase({ some_key: { some_other_key: true }) 2// { 'Some-Key': { 'Some-Other-Key': true }}
noCase
1noCase({ some_key: { some_other_key: true }) 2// { 'some key': { 'some other key': true }}
paramCase
1paramCase({ some_key: { some_other_key: true }) 2// { 'some-key': { 'some-other-key': true }}
pascalCase
1pascalCase({ some_key: { some_other_key: true }) 2// { SomeKey: { SomeOtherKey: true }}
pathCase
1pathCase({ some_key: { some_other_key: true }) 2// { 'some/key': { 'some/other/key': true }}
sentenceCase
1sentenceCase({ some_key: { some_other_key: true }) 2// { 'Some key': { 'Some other key': true }}
snakeCase
1snakeCase({ 'some key': { 'some other key': true })
2// { some_key: { some_other_key: true }}
CasedObject
class1import { CasedObject /*, Case */ } from 'change-case-object'
All of the individual functions are available as static members.
1CasedObject.camelCase({ some_key: { some_other_key: true }}) 2// { someKey: { someOtherKey: true }}
1const someObj = { some_key: { 'some other key': true }} 2 3// initialize without changing case 4const foo = new CasedObject(someObj) 5console.info(foo.value) // { some_key: { 'some other key': true }} 6 7// initialize and change case 8const bar = new CasedObject(someObj, { case: 'camel' }) 9console.info(bar.value) // { someKey: { someOtherKey: true }} 10 11// initialize and change case using enum 12const baz = new CasedObject(someObj, { case: Case.camel }) 13console.info(baz.value) // { someKey: { someOtherKey: true }} 14 15// output the value with keys in a different case 16console.info(baz.snakeCase) // { some_key: { some_other_key: true }} 17console.info(baz.value) // { someKey: { someOtherKey: true }} 18 19// change the case of the value's keys 20baz.value = baz.snakeCase 21console.info(baz.value) // { some_key: { some_other_key: true }}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 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
security policy file not detected
Details
Reason
project is not fuzzed
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