🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

modify-keys

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modify-keys

Modify the keys of an object

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

modify-keys

Modify the keys of an object

Install

npm install modify-keys

Usage

import modifyKeys from 'modify-keys';

modifyKeys({FOO: true, bAr: false}, (key, value) => key.toLowerCase());
//=> {foo: true, bar: false}

API

modifyKeys(input, transformer)

Modifies the keys and returns a new object.

input

Type: object

transformer(key, value)

Type: Function

Receives the key and value for each item and is expected to return the new key.

See modify-values for modifying the values of an object.

Keywords

object

FAQs

Package last updated on 18 Oct 2021

Did you know?

Socket

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.

Install

Related posts