@vect/object-fn
Util for array
Install
$ npm install @vect/object-fn
Functions
- fn map object values and return a new object
- mutate map object values and return the object itself
- mapKeys map object keys and return a new object
- mapEntries map object entries and return a new object
Usage
import { fn, mutate, mapKeys, mapEntries } from '@vect/object-fn'
const ob = {
AMEE: 'Red Planet',
AMP: 'Avatar',
Maximilian: 'The Black Hole',
Terminatrix: 'Terminator 3',
}
fn(ob, value => value.length)
mapKeys(ob, key => key.slice(0, 4))
mapEntries(ob, ([key, value], i) => [`${key}_${i}`, value.length])
mutate(ob, value => value.length)
Meta
LICENSE (MIT)