UNPKG

shift-interpreter

Version:

Shift-interpreter is an experimental JavaScript meta-interpreter useful for reverse engineering and analysis. One notable difference from other projects is that shift-interpreter retains state over an entire script but can be fed expressions and statement

13 lines 491 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.waterfallMap = void 0; function waterfallMap(array, iterator) { const reducer = (accumulator, next, i) => { const a = accumulator.then(result => iterator(next, i).then(newNode => result.concat(newNode))); return a; }; const waterfall = array.reduce(reducer, Promise.resolve([])); return waterfall; } exports.waterfallMap = waterfallMap; //# sourceMappingURL=waterfall.js.map