Miss any of our Open RFC calls?Watch the recordings here! »

@extra-map/scan-until.min

2.2.6 • Public • Published

Finds key of first entry passing a test. 🏃 📼 📦 🌔 📒

Alternatives: scanWhile, scanUntil.
This is part of package extra-map.

This is browserified, minified version of @extra-map/scan-until.
It is exported as global variable map_scanUntil.
CDN: unpkg, jsDelivr.

map.scanUntil(x, ft);
// x:  a map
// ft: test function (v, k, x)
const map = require('extra-map');
 
var x = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 2]]);
map.scanUntil(x, v => v % 2 === 0);
// 'b'                       ^
 
map.scanUntil(x, v => v % 8 === 0);
// undefined

references

Install

npm i @extra-map/scan-until.min

DownloadsWeekly Downloads

60

Version

2.2.6

License

MIT

Unpacked Size

9.21 kB

Total Files

19

Last publish

Collaborators

  • avatar