![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
The snakeize npm package is used to convert object keys to snake_case. This is particularly useful when working with APIs or databases that follow the snake_case naming convention.
Convert object keys to snake_case
This feature allows you to convert the keys of an object from camelCase or other formats to snake_case.
const snakeize = require('snakeize');
const input = { firstName: 'John', lastName: 'Doe' };
const output = snakeize(input);
console.log(output); // { first_name: 'John', last_name: 'Doe' }
Nested object key conversion
This feature allows you to convert the keys of nested objects to snake_case.
const snakeize = require('snakeize');
const input = { user: { firstName: 'John', lastName: 'Doe' }, age: 30 };
const output = snakeize(input);
console.log(output); // { user: { first_name: 'John', last_name: 'Doe' }, age: 30 }
The camelcase-keys package converts object keys to camelCase. It is similar to snakeize but focuses on converting keys to camelCase instead of snake_case.
The decamelize-keys package converts object keys from camelCase to another format, such as snake_case. It is similar to snakeize but offers more flexibility in the target format.
Lodash is a utility library that provides a wide range of functions for manipulating objects, arrays, and other data structures. It includes a method for converting object keys to snake_case, but it is a more general-purpose library compared to snakeize.
recursively transform key strings from camel-case to underscore-style. Derives directly from substack's camelize
var snakeize = require('snakeize');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'FooBar': 'baz' },
{ 'CheeseID': 'wensleydale' }
]
};
var res = snakeize(obj);
console.log(JSON.stringify(res, null, 2));
output:
{
"fee_fie_foe": "fum",
"beep_boop": [
{
"abc_xyz": "mno"
},
{
"foo_bar": "baz"
},
{
"cheese_id": "wensleydale"
}
]
}
var snakeize = require('snakeize')
Convert the key strings in obj
from camel-case to underscore-stlye recursively.
With npm do:
npm install snakeize
To use in the browser, use browserify or component:
component install nathan7/snakeize
MIT
FAQs
recursively transform key strings from camel-case to underscore-style
The npm package snakeize receives a total of 0 weekly downloads. As such, snakeize popularity was classified as not popular.
We found that snakeize 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.