rikey
v0.1.0
Published
Useful utilities for manipulating–and creating–Object instances.
Downloads
34
Maintainers
Readme
🧰 rikey
(pronouned rē-kē, because rekey
was taken)
Useful utilities for manipulating–and creating–Object instances.
Install
Via npm
npm install --save rikey
Via Yarn
yarn add rikey
How to use
reKey
import { reKey } from 'rikey'
const newKeys = reKey({
oldKey: 'something',
olderKey: 'nothing',
}, {
oldKey: 'newKey',
olderKey: 'newerKey'
})
console.log(newKeys)
Output: { newKey: 'something', newerKey: 'nothing' }
mapKeys
const mappedKeys = mapKeys([0, 1, 2], ['first', 'second', 'third'])
console.lot(mappedKeys)
Output: { first: 0, second: 1, third: 2 }