Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 4, 2024 via pnpm
Package summary
Share
0
issues
2
licenses
4
MIT
1
(MIT OR CC0-1.0)
Package created
27 Oct 2015
Version published
30 Oct 2022
Maintainers
1
Total deps
5
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
decamelize-keys@2.0.1
decamelize@6.0.0
map-obj@4.3.0
quick-lru@6.1.2

(MIT OR CC0-1.0)

Public Domain
1 Packages, Including:
type-fest@3.13.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of decamelize-keys 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
decamelize6.0.02.69 kBMIT
prod
map-obj4.3.03.12 kBMIT
prod
quick-lru6.1.24.66 kBMIT
prod
type-fest3.13.176.66 kB(MIT OR CC0-1.0)
prod

Visualizations

Frequently Asked Questions

What does decamelize-keys do?

Decamelize-keys is a convenient npm package used to convert object keys from camel case to another style using a separator. This module is designed to transform both individual objects and arrays of objects. This can be particularly useful in scenarios where you need to interact with an API that doesn't follow JavaScript's conventions or if you're dealing with database records and the column names aren't in camel case.

How do you use decamelize-keys?

You can easily use decamelize-keys package by first installing it via npm using the command npm install decamelize-keys.

To convert an object's keys, you can use the decamelizeKeys function as follows:

import decamelizeKeys from 'decamelize-keys';

// Convert an object
let decamelizedObj = decamelizeKeys({fooBar: true});
console.log(decamelizedObj);  // Output: {foo_bar: true}

You can also convert an array of objects:

import decamelizeKeys from 'decamelize-keys';

// Convert an array of objects
let decamelizedArray = decamelizeKeys([{fooBar: true}, {barFoo: false}]);
console.log(decamelizedArray);  // Output: [{foo_bar: true}, {bar_foo: false}]

The decamelizeKeys function also accepts an options object, where you can provide a different separator, exclude certain keys from being decamelized, and even recurse nested objects:

import decamelizeKeys from 'decamelize-keys';

// Use a different separator
let decamelizedObj = decamelizeKeys({fooBar: true}, {separator: '-'});
console.log(decamelizedObj);  // Output: {'foo-bar': true}

// Recurse nested objects
let decamelizedObj = decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
console.log(decamelizedObj);  // Output: {foo_bar: true, nested: {unicorn_rainbow: true}}

Where are the decamelize-keys docs?

The documents for decamelize-keys npm package can be found on its GitHub repository at https://github.com/sindresorhus/decamelize-keys. The README file there effectively works as the docs, providing installation guidance, code usage examples and available API options.