UNPKG

@uk/tool

Version:
27 lines 641 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ArrayMap extends Map { find(cb) { for (const pair of this) { if (cb(pair[1], pair[0])) return pair[1]; } } filter(cb) { const rv = []; for (const pair of this) { if (cb(pair[1], pair[0])) rv.push(pair[1]); } return rv; } map(cb) { const rv = []; for (const pair of this) { rv.push(cb(pair[1], pair[0])); } return rv; } } exports.ArrayMap = ArrayMap; //# sourceMappingURL=arraymap.js.map