Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
lowercase-keys
Advanced tools
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.
Lowercase the keys of an object
Check out map-obj
if you need support for deep iteration.
npm install lowercase-keys
import lowercaseKeys from 'lowercase-keys';
lowercaseKeys({FOO: true, bAr: false});
//=> {foo: true, bar: false}
Returns a new object with the keys lowercased.
Available as part of the Tidelift Subscription.
The maintainers of lowercase-keys and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
FAQs
Lowercase the keys of an object
The npm package lowercase-keys receives a total of 18,874,256 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.