【文件属性】:
文件名称:map-obj:将对象键和值映射到新对象
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-01 07:28:43
JavaScript
map-obj
将对象键和值映射到新对象
安装
$ npm install map-obj
用法
const mapObject = require ( 'map-obj' ) ;
const newObject = mapObject ( { foo : 'bar' } , ( key , value ) => [ value , key ] ) ;
//=> {bar: 'foo'}
const newObject = mapObject ( { FOO : true , bAr : { bAz : true } } , ( key , value ) => [ key . toLowerCase ( ) , value ] ) ;
//=> {foo: true, bar: {bAz: true}}
const newObject = mapObject ( { FOO : tru
【文件预览】:
map-obj-main
----index.js(1KB)
----test.js(3KB)
----package.json(718B)
----index.test-d.ts(1KB)
----readme.md(2KB)
----.github()
--------funding.yml(113B)
--------workflows()
--------security.md(179B)
----license(1KB)
----index.d.ts(3KB)
----.gitignore(23B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitattributes(19B)