Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
lowercase-keys
Advanced tools
Package description
The lowercase-keys npm package is designed to convert the keys of an object to lowercase. It is a simple utility that can be particularly useful when dealing with data that may have inconsistent capitalization in its keys and you need to ensure uniformity for processing or matching purposes.
Lowercase Object Keys
This feature allows you to convert all keys in an object to lowercase. It's particularly useful for normalizing data received from different sources that may not adhere to a consistent capitalization scheme.
{"const lowercaseKeys = require('lowercase-keys');\nconst myObj = {'Name': 'John', 'AGE': 30, 'Country': 'USA'};\nconst lowercasedObj = lowercaseKeys(myObj);\nconsole.log(lowercasedObj); // Output: { name: 'John', age: 30, country: 'USA' }"}
Similar to lowercase-keys, camelcase-keys converts the keys in an object to camelCase. It's useful for situations where camelCase is the desired or required key format, providing a different kind of normalization compared to lowercase-keys.
This package converts object keys to snake_case. It serves a similar purpose to lowercase-keys in terms of normalizing key names, but it targets a different naming convention, offering flexibility depending on the specific case format needs.
Readme
Lowercase the keys of an object
$ npm install lowercase-keys
const lowercaseKeys = require('lowercase-keys');
lowercaseKeys({FOO: true, bAr: false});
//=> {foo: true, bar: false}
Returns a new object with the keys lowercased.
MIT © Sindre Sorhus
FAQs
Lowercase the keys of an object
The npm package lowercase-keys receives a total of 17,225,820 weekly downloads. As such, lowercase-keys popularity was classified as popular.
We found that lowercase-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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.