UNPKG

fast-iterable

Version:

Provides LINQ-like fluent api operations for iterables and async iterables (ES2018+).

18 lines (17 loc) 742 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.augmentIterableRecipe = void 0; const augmentative_iterable_1 = require("augmentative-iterable"); const types_internal_1 = require("../types-internal"); const prepare_1 = require("../types-internal/prepare"); function augmentIterableRecipe(augmentIterable, clone) { if (clone) { return function (action) { return augmentIterable(this[types_internal_1.orderAssured] ? (0, augmentative_iterable_1.itClone)(this) : this, (0, prepare_1.prepare)(action)); }; } return function (action) { return augmentIterable(this, (0, prepare_1.prepare)(action)); }; } exports.augmentIterableRecipe = augmentIterableRecipe;