Installations
npm install @replygirl/change-case-object
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
>=12.x
Typescript Support
Yes
Node Version
NPM Version
Statistics
2 Stars
27 Commits
8 Branches
1 Contributors
Updated on 06 May 2022
Languages
TypeScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
21,386
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
2
change-case-object
Recursively change the case of an object's keys
Installation
1yarn add @replygirl/change-case-object
Usage
Functions
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
class
1import { CasedObject /*, Case */ } from 'change-case-object'
Static functions
All of the individual functions are available as static members.
1CasedObject.camelCase({ some_key: { some_other_key: true }}) 2// { someKey: { someOtherKey: true }}
Instances
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 }}
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: ISC License: LICENSE.md:0
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
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-github.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-github.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-github.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-github.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-github.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-github.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-github.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-github.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-npm.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-npm.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-npm.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/replygirl/change-case-object/publish-npm.yml/main?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 4 third-party GitHubAction dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/build.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish-github.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish-npm.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Score
3.8
/10
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 MoreOther packages similar to @replygirl/change-case-object
change-case
Transform a string between `camelCase`, `PascalCase`, `Capital Case`, `snake_case`, `kebab-case`, `CONSTANT_CASE` and others
change-case-all
All change-case methods bundled in a single module
didyoumean
Match human-quality input to potential matches by edit distance.
change-object-case
Change case of object and arrays