UNPKG

edgerender-yatl

Version:

Yet Another Template Language

33 lines 929 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.async_any = exports.async_every = exports.async_reduce = exports.async_map = void 0; async function async_map(items, func) { return await Promise.all(items.map(item => func(item))); } exports.async_map = async_map; async function async_reduce(items, func, value) { for (const item of items) { value = await func(value, item); } return value; } exports.async_reduce = async_reduce; async function async_every(items, func) { for (const item of items) { if (!(await func(item))) { return false; } } return true; } exports.async_every = async_every; async function async_any(items, func) { for (const item of items) { if (await func(item)) { return true; } } return false; } exports.async_any = async_any; //# sourceMappingURL=async_iter.js.map