{"_id":"@amphibian/map","_rev":"7-f2fb541b808f236917ce8490779c2677","name":"@amphibian/map","description":"return items from an array or object based on a mapping function","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@amphibian/map","version":"1.0.0","description":"return items from an array or object based on a mapping function","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/map.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/map/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/map#README","dependencies":{"@amphibian/for-own":"^1.0.14","@amphibian/is-array":"^1.0.5","@amphibian/is-object":"^1.0.5","@amphibian/is-undefined":"^1.0.2","@amphibian/iterate-up-array":"^1.0.1"},"gitHead":"7f1979c8bb3b913c290c643349480e115579b8cd","_id":"@amphibian/map@1.0.0","_shasum":"b39da44e4626a040d89c4fde0b32f54c28fcdb0a","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.1","_npmUser":{"name":"thomaslindstr_m","email":"t@hom.as"},"dist":{"shasum":"b39da44e4626a040d89c4fde0b32f54c28fcdb0a","tarball":"https://registry.npmjs.org/@amphibian/map/-/map-1.0.0.tgz","integrity":"sha512-JQOL48ZHJb+dsRT8LmlIuEaG6nQSy1lhr20QVCGOcGCDgiPiRWY9RIz1ahFr9tvTY3j1968ks7AoMzKhGy8zUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAHTthNzX06f9CE0eEW4njCFuhhVQ9HIrNXHW692FZlQIgI9gRpt9ID552M2+v7l4ur3wbbmh8h74he/uLK3hy6Lg="}]},"maintainers":[{"name":"thomaslindstr_m","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/map-1.0.0.tgz_1490783434085_0.7624824072699994"},"directories":{}},"1.0.1":{"name":"@amphibian/map","version":"1.0.1","description":"return items from an array or object based on a mapping function","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/map.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/map/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/map#README","dependencies":{"@amphibian/for-own":"^1.0.14","@amphibian/is-array":"^1.0.5","@amphibian/is-object":"^1.0.5","@amphibian/is-undefined":"^1.0.2","@amphibian/iterate-up-array":"^1.0.1"},"gitHead":"05e8f10fd16ba134297b07a3939ae78325a1bf9f","_id":"@amphibian/map@1.0.1","_npmVersion":"5.0.1","_nodeVersion":"8.0.0","_npmUser":{"name":"thomaslindstr_m2","email":"t@hom.as"},"dist":{"integrity":"sha512-wyRu4e0ggVmsvFplQUo+32YW3SAqepwnbNm7Da1pNAnOzHUyBIPoZM0VVm9jBE41zfGFefm/U6mkkxVKTWu+Mw==","shasum":"7545a1fd54e02e84288cf8146770d89880d2d931","tarball":"https://registry.npmjs.org/@amphibian/map/-/map-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAhaENXzvULAM8YRm1Ol6SHzfgVfVaSKKB/Npsg1kEevAiEAr3rOqjQzOMSH13BUvvpH2nETpxJ3BRLNynZWBVzc+h8="}]},"maintainers":[{"name":"thomaslindstr_m","email":"t@hom.as"},{"name":"thomaslindstr_m2","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/map-1.0.1.tgz_1496959293578_0.8454042745288461"},"directories":{}}},"readme":"# map\n\n[![build status](https://gitlab.com/thomaslindstr_m/map/badges/master/build.svg)](https://gitlab.com/thomaslindstr_m/map/commits/master)\n\nreturn items from an array or object based on a mapping function\n\n```\nnpm install @amphibian/map\n```\n\n```javascript\nvar map = require('@amphibian/map');\nvar array = ['zero', 'one', 'two', 'three', 'four'];\n\nmap(array, (index, i) => i); // > [0, 1, 2, 3, 4]\nmap(array, (index, i) => {\n    if (i === 1) {\n        return; // NOTE `undefined` is ignored\n    }\n\n    return i + 10;\n}); // > [10, 12, 13, 14]\n\nvar object = {\n    zero: {hello: true},\n    one: {hello: false},\n    two: {hello: true},\n    three: {hello: false}\n};\n\nmap(object, (key, value) => value); /* > [\n    {hello: true}, {hello: false}, {hello: true}, {hello: false}\n] */\n\n// You can also stop the mapping when you're satisfied with the results\nvar results = map(array, (index, i, end, results) => {\n    if (results.length < 2) {\n        return index;\n    } else {\n        end();\n        return index;\n    }\n});\n\nconsole.log(results); // > ['zero', 'one', 'two']\n```\n","maintainers":[{"email":"t@hom.as","name":"thomaslindstr_m"}],"time":{"modified":"2022-06-12T14:39:51.827Z","created":"2017-03-29T10:30:34.658Z","1.0.0":"2017-03-29T10:30:34.658Z","1.0.1":"2017-06-08T22:01:34.539Z"},"homepage":"https://gitlab.com/thomaslindstr_m/map#README","repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/map.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"bugs":{"url":"https://gitlab.com/thomaslindstr_m/map/issues"},"license":"ISC","readmeFilename":"README.md"}