@vect/object-zipper
v0.8.0
Published
Zip function
Downloads
289
Readme
@vect/object-zipper
Util for array
Install
$ npm install @vect/object-zipper
Functions
- zipper map object values and return a new object
- mutazip 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 { zipper, mutazip, mapKeys, mapEntries } from '@vect/object-zipper'
const ot = {
AMEE: 'Red Planet',
AMP: 'Avatar',
Maximilian: 'The Black Hole',
Terminatrix: 'Terminator 3',
}
zipper(ot, value => value.length)
mapKeys(ot, key => key.slice(0, 4))
mapEntries(ot, ([key, value], i) => [`${key}_${i}`, value.length])
mutazip(ot, value => value.length)