0.1.5 • Published 6 years ago
entries-findall v0.1.5
entries-findall
NOTE: entries-findall was renamed to @extra-entries/find-all.
Get all values in entries that satisfy the test, like Array.find().
const findAll = require('entries-findall');
// findAll(<entries>, <test function>, [this], [begin=0], [end], [target=[]], [at])
// - <test function>(<value>, <key>, <entries>)
// -> <target>
findAll([5, 3, 9, 1, 1, 6].entries(), (v) => v>5);
// [9, 6]
findAll(new Set(['length', 'mass', 'time']).entries(), (v, k, ent) => k.includes('i'));
// ['time']
findAll(Object.entries({t: 20, i: 9, m: 13, e: 5}), (v, k, ent) => v<10);
// [9, 5]