Package Exports
- @vect/object-mapper
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vect/object-mapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@vect/object-mapper
Util for array
Install
$ npm install @vect/object-mapperFunctions
- mapper 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 { mapper, mutate, mapKeys, mapEntries } from '@vect/object-mapper'
const ob = {
AMEE: 'Red Planet',
AMP: 'Avatar',
Maximilian: 'The Black Hole',
Terminatrix: 'Terminator 3',
}
mapper(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)