{"_id":"@amphibian/filter","_rev":"5-bfa60880d2200ad4f6d589cf84be231c","name":"@amphibian/filter","description":"matches items in an array or object that return true in the filtering function","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@amphibian/filter","version":"1.0.0","description":"matches items in an array or object that return true in the filtering function","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/filter.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/filter/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/filter#README","dependencies":{"@amphibian/for-own":"^1.0.14","@amphibian/is-array":"^1.0.5","@amphibian/is-object":"^1.0.5","@amphibian/iterate-up-array":"^1.0.1"},"_id":"@amphibian/filter@1.0.0","_shasum":"8964439665335d39da3428322e3a502016cadaae","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"8964439665335d39da3428322e3a502016cadaae","tarball":"https://registry.npmjs.org/@amphibian/filter/-/filter-1.0.0.tgz","integrity":"sha512-K9Ehg/2P5MnT8IyXKmslzsj+bn/0s/Z0GGEEYeKeI+E0olXIEWQkM7LlwSDxQvfRZn8kg9tihZKL5aNrDEpwWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4Xrd+e/V1HQq98AccYLLP/JEeTEoyib+1thttI+hsnAiBjvkPeP4IskJZK/WUB2bemG8LWK81lC0NOqtb/Bn6jew=="}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/filter-1.0.0.tgz_1487286755930_0.3015609811991453"},"directories":{}}},"readme":"# filter\n\n[![build status](https://gitlab.com/thomaslindstr_m/filter/badges/master/build.svg)](https://gitlab.com/thomaslindstr_m/filter/commits/master)\n\nmatches items in an array or object that return true in the filtering function\n\n```\nnpm install @amphibian/filter\n```\n\n```javascript\nvar filter = require('@amphibian/filter');\nvar array = ['zero', 'one', 'two', 'three', 'four'];\n\nfilter(array, (index) => index !== 'zero'); // > ['one', 'two', 'three', 'four']\nfilter(array, (index, i) => i < 3); // > ['zero', 'one', 'two']\n\nvar object = {\n    zero: {hello: true},\n    one: {hello: false},\n    two: {hello: true},\n    three: {hello: false}\n};\n\nfilter(object, (key, value) => value.hello === true); /* > {\n    zero: {hello: true},\n    two: {hello: true}\n} */\n\n// You can also stop the filtering when you're satisfied with the results\nvar matches = filter(array, (index, i, end, matches) => {\n    if (matches.length < 3) {\n        return true;\n    } else {\n        end();\n    }\n});\n\nconsole.log(matches); // > ['zero', 'one', 'two']\n```\n","maintainers":[{"email":"t@hom.as","name":"thomaslindstr_m"}],"time":{"modified":"2022-06-12T14:39:48.340Z","created":"2017-02-16T23:12:36.490Z","1.0.0":"2017-02-16T23:12:36.490Z"},"homepage":"https://gitlab.com/thomaslindstr_m/filter#README","repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/filter.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"bugs":{"url":"https://gitlab.com/thomaslindstr_m/filter/issues"},"license":"ISC","readmeFilename":"README.md"}