Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@jerridan/convert-keys
Advanced tools
A tool for converting object keys between camel case, snake case and kebab case.
ConvertKeys
is a tool for converting object keys between camel case, snake case and kebab case.
Install ConvertKeys
via npm or yarn:
npm install @jerridan/convert-keys
# or
yarn add @jerridan/convert-keys
ConvertKeys exports three functions:
toSnakeCase
-> for converting keys to snake casetoCamelCase
-> for converting keys to camel casetoKebabCase
-> for converting keys to kebab caseEach function accepts two arguments:
input
-> the object or array to convertoverrides
-> an optional object containing overrides for specific key conversionsConverting an object
toSnakeCase({ objectKey: "value" });
// Output: { object_key: "value" }
Converting a complex nested object
toCamelCase({
object_key: [
[{ nested_key: 1 }, { nested_key: 2 }],
[{ nested_key: 3 }, { nested_key: 4 }],
],
});
// Output:
// {
// objectKey: [
// [{ nestedKey: 1 }, { nestedKey: 2 }],
// [{ nestedKey: 3 }, { nestedKey: 4 }],
// ],
// }
Using overrides
const overrides = { nestedKey: "overridden-key" };
toKebabCase({ objectKey: { nestedKey: "value" } }, overrides);
// Output:
// { "object-key": { "overridden-key": "value" } }
Contributions to this project are welcome. Please follow these general guidelines:
This project is released under the MIT License. For more details, see the LICENSE file in the repository.
FAQs
A tool for converting object keys between camel case, snake case and kebab case.
We found that @jerridan/convert-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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.