{"_id":"map-obj","_rev":"4106732","name":"map-obj","description":"Map object keys and values into a new object","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-01-11T18:56:15.000Z","created":"2014-10-12T11:47:07.079Z","6.0.0":"2025-09-21T07:21:47.851Z","5.0.2":"2022-06-21T22:08:50.354Z","5.0.1":"2022-02-28T14:51:35.102Z","5.0.0":"2021-10-18T10:25:03.911Z","4.3.0":"2021-09-19T10:14:33.997Z","4.2.1":"2021-04-07T04:48:13.189Z","4.2.0":"2021-03-10T07:02:36.520Z","4.1.0":"2019-06-15T06:07:32.018Z","4.0.0":"2019-06-07T07:52:59.540Z","3.1.0":"2019-04-22T06:44:04.714Z","3.0.0":"2018-08-08T06:44:23.091Z","2.0.0":"2016-09-17T05:10:08.778Z","1.0.1":"2015-05-02T18:02:46.655Z","1.0.0":"2014-10-12T11:47:07.079Z"},"users":{"scott.m.sarsfield":true,"rocket0191":true,"nichoth":true,"cr8tiv":true,"tangj1206":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"versions":{"6.0.0":{"name":"map-obj","version":"6.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"_id":"map-obj@6.0.0","gitHead":"10b32031c6f31be38794bbe0c569e67a5f9182cd","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_nodeVersion":"20.19.5","_npmVersion":"10.9.2","dist":{"shasum":"3deea853bc9e2d39b294b6bfecbf715a33367286","size":4178,"noattachment":false,"key":"/map-obj/-/map-obj-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/map-obj_6.0.0_1758439307677_0.8146756573423568"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-21T07:21:47.851Z","publish_time":1758439307851,"_source_registry_name":"default","_cnpm_publish_time":1758439307851},"5.0.2":{"name":"map-obj","version":"5.0.2","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.45.0"},"types":"./index.d.ts","gitHead":"4257d4dd8564efa2372c6964eb16463cb3af898d","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@5.0.2","_nodeVersion":"12.22.1","_npmVersion":"8.3.2","dist":{"shasum":"174ad9f7e5e4e777a219126d9a734ff3e14a1c68","size":3089,"noattachment":false,"key":"/map-obj/-/map-obj-5.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-5.0.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_5.0.2_1655849330183_0.9052497581569097"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-21T22:10:52.177Z","publish_time":1655849330354,"_cnpm_publish_time":1655849330354},"5.0.1":{"name":"map-obj","version":"5.0.1","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.45.0"},"types":"./index.d.ts","gitHead":"27e93234ecb7f9ac483f3800b31a2e10e532e79f","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@5.0.1","_nodeVersion":"12.22.1","_npmVersion":"8.3.2","dist":{"shasum":"7623fb9f565284860977a96f9295fa155d31644c","size":3070,"noattachment":false,"key":"/map-obj/-/map-obj-5.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-5.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_5.0.1_1646059894956_0.8518763740331532"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-28T14:51:38.963Z","publish_time":1646059895102,"_cnpm_publish_time":1646059895102},"5.0.0":{"name":"map-obj","version":"5.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.45.0"},"gitHead":"5047229853b333cb79e0b067e4a5a352e5e515e9","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@5.0.0","_nodeVersion":"16.10.0","_npmVersion":"7.20.3","dist":{"shasum":"126c98596b63927d7360f287cccc67177aa1938b","size":3055,"noattachment":false,"key":"/map-obj/-/map-obj-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_5.0.0_1634552703760_0.8241607271773759"},"_hasShrinkwrap":false,"publish_time":1634552703911,"_cnpm_publish_time":1634552703911},"4.3.0":{"name":"map-obj","version":"4.3.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^2.0.0","tsd":"^0.14.0","xo":"^0.24.0"},"gitHead":"1e5c466ee0f293e91465ecd53d74ecdeb90cb4e4","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@4.3.0","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"shasum":"9304f906e93faae70880da102a9f1df0ea8bb05a","size":3196,"noattachment":false,"key":"/map-obj/-/map-obj-4.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-4.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_4.3.0_1632046473840_0.14921344042886675"},"_hasShrinkwrap":false,"publish_time":1632046473997,"_cnpm_publish_time":1632046473997},"4.2.1":{"name":"map-obj","version":"4.2.1","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^2.0.0","tsd":"^0.14.0","xo":"^0.24.0"},"gitHead":"6a1010987d229a81a14b80015aaca83f3bc791e8","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@4.2.1","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e4ea399dbc979ae735c83c863dd31bdf364277b7","size":2863,"noattachment":false,"key":"/map-obj/-/map-obj-4.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-4.2.1.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_4.2.1_1617770893048_0.6852322629466565"},"_hasShrinkwrap":false,"publish_time":1617770893189,"_cnpm_publish_time":1617770893189},"4.2.0":{"name":"map-obj","version":"4.2.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^2.0.0","tsd":"^0.14.0","xo":"^0.24.0"},"gitHead":"81b0ba19e5360a5c00980e9dfa03e1891ccc6d7a","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@4.2.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0e8bc823e2aaca8a0942567d12ed14f389eec153","size":2824,"noattachment":false,"key":"/map-obj/-/map-obj-4.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-4.2.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_4.2.0_1615359756344_0.3099350644767842"},"_hasShrinkwrap":false,"publish_time":1615359756520,"_cnpm_publish_time":1615359756520},"4.1.0":{"name":"map-obj","version":"4.1.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^2.0.0","tsd":"^0.7.3","xo":"^0.24.0"},"gitHead":"ab153427cc788e28448f2e1800eaec1c43610d38","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@4.1.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b91221b542734b9f14256c0132c897c5d7256fd5","size":2730,"noattachment":false,"key":"/map-obj/-/map-obj-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_4.1.0_1560578851920_0.028448962438873515"},"_hasShrinkwrap":false,"publish_time":1560578852018,"_cnpm_publish_time":1560578852018},"4.0.0":{"name":"map-obj","version":"4.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^2.0.0","tsd":"^0.7.3","xo":"^0.24.0"},"gitHead":"d35fa2d91642d269b7bfe2ebfe7c9915376fa92d","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@4.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"20a2ac4341c42570a85de7a976ab6ba60e3c0870","size":2643,"noattachment":false,"key":"/map-obj/-/map-obj-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_4.0.0_1559893979425_0.9001481014415618"},"_hasShrinkwrap":false,"publish_time":1559893979540,"_cnpm_publish_time":1559893979540},"3.1.0":{"name":"map-obj","version":"3.1.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["map","object","key","keys","value","values","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"5556028fd392f4fbdf18c1c604b0b0c883dd99f7","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@3.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3be9810d926db2f8612c728a2e95e03b7f109241","size":2500,"noattachment":false,"key":"/map-obj/-/map-obj-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_3.1.0_1555915444512_0.3163818961387286"},"_hasShrinkwrap":false,"publish_time":1555915444714,"_cnpm_publish_time":1555915444714},"3.0.0":{"name":"map-obj","version":"3.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["map","obj","object","key","keys","value","values","val","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"4db51b6f5f6d2b617bc80bb66dd6a6e528dc4cb7","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@3.0.0","_npmVersion":"6.3.0","_nodeVersion":"8.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4221cc62360f88c0735f9e7c0813bd889657f490","size":2032,"noattachment":false,"key":"/map-obj/-/map-obj-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-obj_3.0.0_1533710662889_0.49796460121473984"},"_hasShrinkwrap":false,"publish_time":1533710663091,"_cnpm_publish_time":1533710663091},"2.0.0":{"name":"map-obj","version":"2.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/map-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["map","obj","object","key","keys","value","values","val","iterate","iterator","rename","modify","deep","recurse","recursive"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"40ce3a8b7d419249a6c0d83031b5d3214b9bf8ed","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj#readme","_id":"map-obj@2.0.0","_shasum":"a65cd29087a92598b8791257a523e021222ac1f9","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a65cd29087a92598b8791257a523e021222ac1f9","size":2082,"noattachment":false,"key":"/map-obj/-/map-obj-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/map-obj-2.0.0.tgz_1474089008506_0.09945452911779284"},"directories":{},"publish_time":1474089008778,"_cnpm_publish_time":1474089008778,"_hasShrinkwrap":false},"1.0.1":{"name":"map-obj","version":"1.0.1","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/map-obj"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["map","obj","object","key","keys","value","values","val","iterate","iterator"],"devDependencies":{"ava":"0.0.4"},"gitHead":"a4f2d49ae6b5f7c0e55130b49ab0412298b797bc","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj","_id":"map-obj@1.0.1","_shasum":"d933ceb9205d82bdcf4886f6742bdc2b4dea146d","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d933ceb9205d82bdcf4886f6742bdc2b4dea146d","size":1549,"noattachment":false,"key":"/map-obj/-/map-obj-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1430589766655,"_cnpm_publish_time":1430589766655,"_hasShrinkwrap":false},"1.0.0":{"name":"map-obj","version":"1.0.0","description":"Map object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/map-obj"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["map","obj","object","key","keys","value","values","val","iterate"],"devDependencies":{"ava":"0.0.4"},"gitHead":"96c3c4363f3c7d192f33305884f129004f5c4bcb","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"homepage":"https://github.com/sindresorhus/map-obj","_id":"map-obj@1.0.0","_shasum":"bcbdf6756758763c182daf79e18094a2f1c85766","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"bcbdf6756758763c182daf79e18094a2f1c85766","size":878,"noattachment":false,"key":"/map-obj/-/map-obj-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/map-obj/download/map-obj-1.0.0.tgz"},"directories":{},"publish_time":1413114427079,"_cnpm_publish_time":1413114427079,"_hasShrinkwrap":false}},"readme":"# map-obj\n\n> Map object keys and values into a new object\n\n## Install\n\n```sh\nnpm install map-obj\n```\n\n## Usage\n\n```js\nimport mapObject, {mapObjectSkip} from 'map-obj';\n\n// Swap keys and values\nconst newObject = mapObject({foo: 'bar'}, (key, value) => [value, key]);\n//=> {bar: 'foo'}\n\n// Convert keys to lowercase (shallow)\nconst newObject = mapObject({FOO: true, bAr: {bAz: true}}, (key, value) => [key.toLowerCase(), value]);\n//=> {foo: true, bar: {bAz: true}}\n\n// Convert keys to lowercase (deep recursion)\nconst newObject = mapObject({FOO: true, bAr: {bAz: true}}, (key, value) => [key.toLowerCase(), value], {deep: true});\n//=> {foo: true, bar: {baz: true}}\n\n// Filter out specific values\nconst newObject = mapObject({one: 1, two: 2}, (key, value) => value === 1 ? [key, value] : mapObjectSkip);\n//=> {one: 1}\n\n// Include symbol keys\nconst symbol = Symbol('foo');\nconst newObject = mapObject({bar: 'baz', [symbol]: 'qux'}, (key, value) => [key, value], {includeSymbols: true});\n//=> {bar: 'baz', [Symbol(foo)]: 'qux'}\n```\n\n## API\n\n### mapObject(source, mapper, options?)\n\n#### source\n\nType: `object`\n\nThe source object to copy properties from.\n\n#### mapper\n\nType: `(sourceKey, sourceValue, source) => [targetKey, targetValue, mapperOptions?] | mapObjectSkip`\n\nA mapping function.\n\n> [!NOTE]\n> When `options.deep` is `true`, the mapper receives keys and values from nested objects and arrays. The `sourceKey` parameter is typed as `string | symbol` and `sourceValue` as `unknown` to reflect the actual runtime behavior when recursing into unknown shapes. The third argument `source` is always the original input object, not the current nested owner.\n\n##### mapperOptions\n\nType: `object`\n\n###### shouldRecurse\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to recurse into `targetValue`.\n\nRequires `deep: true`.\n\n#### options\n\nType: `object`\n\n##### deep\n\nType: `boolean`\\\nDefault: `false`\n\nRecurse nested objects and objects in arrays.\n\nBuilt-in objects like `RegExp`, `Error`, `Date`, `Map`, `Set`, `WeakMap`, `WeakSet`, `Promise`, `ArrayBuffer`, `DataView`, typed arrays (Uint8Array, etc.), and `Blob` are not recursed into. Special objects like Jest matchers are also automatically excluded.\n\n##### includeSymbols\n\nType: `boolean`\\\nDefault: `false`\n\nInclude symbol keys in the iteration.\n\nBy default, symbol keys are completely ignored and not passed to the mapper function. When enabled, the mapper will also be called with symbol keys from the source object, allowing them to be transformed or included in the result. Only enumerable symbol properties are included.\n\n##### target\n\nType: `object`\\\nDefault: `{}`\n\nThe target object to map properties onto.\n\n### mapObjectSkip\n\nReturn this value from a `mapper` function to exclude the key from the new object.\n\n```js\nimport mapObject, {mapObjectSkip} from 'map-obj';\n\nconst object = {one: 1, two: 2};\nconst mapper = (key, value) => value === 1 ? [key, value] : mapObjectSkip;\nconst result = mapObject(object, mapper);\n\nconsole.log(result);\n//=> {one: 1}\n```\n\n## Related\n\n- [filter-obj](https://github.com/sindresorhus/filter-obj) - Filter object keys and values into a new object\n","_attachments":{},"homepage":"https://github.com/sindresorhus/map-obj#readme","bugs":{"url":"https://github.com/sindresorhus/map-obj/issues"},"license":"MIT"}