Socket
Socket
Sign inDemoInstall

lowercase-keys

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

6

index.d.ts

@@ -8,3 +8,3 @@ /**

```
import lowercaseKeys = require('lowercase-keys');
import lowercaseKeys from 'lowercase-keys';

@@ -15,4 +15,2 @@ lowercaseKeys({FOO: true, bAr: false});

*/
declare function lowercaseKeys<T extends unknown>(object: {[key: string]: T}): {[key: string]: T};
export = lowercaseKeys;
export default function lowercaseKeys<T>(object: Record<string, T>): Record<string, T>;

@@ -1,10 +0,3 @@

'use strict';
module.exports = object => {
const result = {};
for (const [key, value] of Object.entries(object)) {
result[key.toLowerCase()] = value;
}
return result;
};
export default function lowercaseKeys(object) {
return Object.fromEntries(Object.entries(object).map(([key, value]) => [key.toLowerCase(), value]));
}
{
"name": "lowercase-keys",
"version": "2.0.0",
"version": "3.0.0",
"description": "Lowercase the keys of an object",
"license": "MIT",
"repository": "sindresorhus/lowercase-keys",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -34,6 +37,6 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.18.0",
"xo": "^0.45.0"
}
}

@@ -1,17 +0,17 @@

# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys)
# lowercase-keys
> Lowercase the keys of an object
Check out [`map-obj`](https://github.com/sindresorhus/map-obj) if you need support for deep iteration.
## Install
```sh
npm install lowercase-keys
```
$ npm install lowercase-keys
```
## Usage
```js
const lowercaseKeys = require('lowercase-keys');
import lowercaseKeys from 'lowercase-keys';

@@ -22,3 +22,2 @@ lowercaseKeys({FOO: true, bAr: false});

## API

@@ -30,5 +29,6 @@

## lowercase-keys for enterprise
## License
Available as part of the Tidelift Subscription.
MIT © [Sindre Sorhus](https://sindresorhus.com)
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.](https://tidelift.com/subscription/pkg/npm-lowercase-keys?utm_source=npm-lowercase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc