Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
object-case-converter
Advanced tools
Convert keys in an javascript object for some cases(camelCase, snake_case, etc.)
Convert keys in an javascript Object or Array to the specific forms(camelCase, snake_case, etc.)
$ npm install --save object-case-converter
import { camelCase, snakeCase } from 'object-case-converter';
const result1 = camelCase(null);
// result1 = null
const result2 = camelCase({
id: '1',
nick_name: 'nick1',
contacts: [{ contact_type: 'phone', value: '000-000-000' }, { contact_type: 'email', value: 'test@email.com' }],
news_letter: { all_email: false, marketing_email: false },
});
// result2 = {
// id: '1',
// nickName: 'nick1',
// contacts: [{ contact_type: 'phone', value: '000-000-000' }, { contact_type: 'email', value: 'test@email.com' }],
// newsLetter: { all_email: false, marketing_email: false },
//}
const result3 = snakeCase([
{ id: '1', nickName: 'nick1', contacts: [{ contactType: 'phone', value: '000-000-000' }, { contactType: 'email', value: 'test@email.com' }] },
{ id: '2', nickName: 'nick2', contacts: [] },
{ id: '3', nickName: 'nick3', contacts: [{ contactType: 'address', value: 'xxx' }] },
], true);
// result3 = [
// { id: '1', nick_name: 'nick1', contacts: [{ contact_type: 'phone', value: '000-000-000' }, { contact_type: 'email', value: 'test@email.com' }] },
// { id: '2', nick_name: 'nick2', contacts: [] },
// { id: '3', nick_name: 'nick3', contacts: [{ contact_type: 'address', value: 'xxx' }] },
//]
var converter = require('object-case-converter');
converter.camelCase(...);
converter.snakeCase(...);
Convert keys in an object or objects in an array to camelCase
Convert keys in an object or objects in an array to snake_case
$ git clone git@github.com:ridibooks/object-case-converter.git
$ cd object-case-converter
$ npm install
Webpack build using Babel (Not required in development.)
$ npm run build
Tests using Jest
$ npm test
FAQs
Convert keys in an javascript object for some cases(camelCase, snake_case, etc.)
The npm package object-case-converter receives a total of 12 weekly downloads. As such, object-case-converter popularity was classified as not popular.
We found that object-case-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.