@proc7ts/push-iterator
Advanced tools
| /** | ||
| * A key of {@link PushIterable} iteration method. | ||
| */ | ||
| const PushIterator__symbol = /*#__PURE__*/ Symbol('push-iterator'); | ||
| function isPushIterable(iterable) { | ||
| return !!iterable[PushIterator__symbol]; | ||
| } | ||
| /** | ||
| * Creates a push iterable implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function iterating over iterable elements conforming to {@link PushIterable.Iterate} requirements. | ||
| * | ||
| * @returns New push iterable instance performing iteration by `forNext` function. | ||
| */ | ||
| function makePushIterable(iterate) { | ||
| return { | ||
| [Symbol.iterator]: PushIterable$iterator, | ||
| [PushIterator__symbol]: iterate, | ||
| }; | ||
| } | ||
| function PushIterable$iterator() { | ||
| return this[PushIterator__symbol](); | ||
| } | ||
| function PushIterator$iterator() { | ||
| return this; | ||
| } | ||
| function PushIterator$next() { | ||
| for (;;) { | ||
| let result; | ||
| const tail = this[PushIterator__symbol](value => { | ||
| result = { value }; | ||
| return true; | ||
| }, 1 /* PushIterationMode.Next */); | ||
| if (result) { | ||
| return result; | ||
| } | ||
| if (tail.isOver()) { | ||
| return { done: true }; | ||
| } | ||
| } | ||
| } | ||
| const PushIterator$empty = { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](_accept, _mode) { | ||
| return this; | ||
| }, | ||
| next: PushIterator$noNext, | ||
| isOver: PushIterator$over, | ||
| }; | ||
| function PushIterator$noNext() { | ||
| return { done: true }; | ||
| } | ||
| function PushIterator$dontIterate(_accept, _mode) { | ||
| // Do not iterate | ||
| } | ||
| function PushIterator$over() { | ||
| return true; | ||
| } | ||
| /** | ||
| * Creates a push iterator implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param forNext - A function iterating over elements conforming to push iteration protocol. | ||
| * | ||
| * @returns New push iterator instance performing iteration by `forNext` function. | ||
| */ | ||
| function makePushIterator(forNext) { | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| } | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next: PushIterator$next, | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function indexed$itemOf(indexed, index) { | ||
| return indexed.item(index); // The index is always valid. | ||
| } | ||
| function indexed$process(indexed, elementOf, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| accept(elementOf(indexed, i)); | ||
| } | ||
| } | ||
| else { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| if (accept(elementOf(indexed, i)) === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function indexed$some(indexed, elementOf, accept) { | ||
| let i = 0; | ||
| const forNext = (accept) => { | ||
| if (i >= indexed.length) { | ||
| return false; | ||
| } | ||
| for (;;) { | ||
| const goOn = accept(elementOf(indexed, i++)); | ||
| if (i >= indexed.length || goOn === false) { | ||
| return false; | ||
| } | ||
| if (goOn === true) { | ||
| return true; | ||
| } | ||
| } | ||
| }; | ||
| if (accept && !forNext(accept)) { | ||
| return PushIterator$empty; | ||
| } | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| } | ||
| }; | ||
| let next = () => { | ||
| if (i < indexed.length) { | ||
| return { value: elementOf(indexed, i++) }; | ||
| } | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| return { done: true }; | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next: () => next(), | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function indexed$iterate(indexed, elementOf) { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => accept && mode > 0 | ||
| ? indexed$process(indexed, elementOf, accept, mode) | ||
| : indexed$some(indexed, elementOf, accept); | ||
| } | ||
| function arrayLike$elementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| function arrayLike$process(array, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| return indexed$process(array, arrayLike$elementOf, accept, mode); | ||
| } | ||
| function arrayLike$some(array, accept) { | ||
| return indexed$some(array, arrayLike$elementOf, accept); | ||
| } | ||
| function arrayLike$iterate(array) { | ||
| return indexed$iterate(array, arrayLike$elementOf); | ||
| } | ||
| function iterable$process(iterable, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| for (const element of iterable) { | ||
| accept(element); | ||
| } | ||
| } | ||
| else { | ||
| for (const element of iterable) { | ||
| if (accept(element) === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function iterator$convert(it, forNext) { | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if ((over = !!accept && !forNext(accept))) { | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| } | ||
| }; | ||
| let next = () => { | ||
| const res = it.next(); | ||
| if (res.done) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| } | ||
| return res; | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next() { | ||
| return next(); | ||
| }, | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function iterator$pusher(it) { | ||
| return accept => { | ||
| for (;;) { | ||
| const res = it.next(); | ||
| if (res.done) { | ||
| return false; | ||
| } | ||
| const status = accept(res.value); | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| /** | ||
| * Iterates over elements of the given iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate elements of. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
| * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| * iteration with, unless `accept` returned `false`. In the latter case the further iteration won't be possible. | ||
| */ | ||
| function iterateIt(iterable, accept, mode = 0 /* PushIterationMode.Some */) { | ||
| if (isPushIterable(iterable)) { | ||
| return iterable[PushIterator__symbol](accept, mode); | ||
| } | ||
| if (Array.isArray(iterable)) { | ||
| return iterateIt$array(iterable, accept, mode); | ||
| } | ||
| return iterateIt$raw(iterable, accept, mode); | ||
| } | ||
| function iterateIt$array(array, accept, mode) { | ||
| return array.length | ||
| ? mode > 0 | ||
| ? arrayLike$process(array, accept, mode) | ||
| : arrayLike$some(array, accept) | ||
| : PushIterator$empty; | ||
| } | ||
| function iterateIt$raw(iterable, accept, mode) { | ||
| if (mode > 0) { | ||
| return iterable$process(iterable, accept, mode); | ||
| } | ||
| const it = iterable[Symbol.iterator](); | ||
| if (isPushIterable(it)) { | ||
| return it[PushIterator__symbol](accept, mode); | ||
| } | ||
| const forEach = iterator$pusher(it); | ||
| return forEach(accept) ? iterator$convert(it, forEach) : PushIterator$empty; | ||
| } | ||
| function flatMapIndexed$(indexed, elementsOf) { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
| return flatMapIndexed$process(indexed, elementsOf, accept, mode); | ||
| } | ||
| let i = 0; | ||
| let subs; | ||
| const forNext = (accept) => { | ||
| if (i >= indexed.length) { | ||
| return false; | ||
| } | ||
| if (!subs) { | ||
| subs = elementsOf(indexed, i); | ||
| } | ||
| for (;;) { | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => (status = accept(element))); | ||
| if (subsTail.isOver()) { | ||
| if (++i >= indexed.length) { | ||
| return false; | ||
| } | ||
| subs = elementsOf(indexed, i); | ||
| } | ||
| else { | ||
| subs = subsTail; | ||
| } | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| return accept && !forNext(accept) ? PushIterator$empty : makePushIterator(forNext); | ||
| }; | ||
| } | ||
| function flatMapIndexed$process(indexed, elementsOf, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| iterateIt(elementsOf(indexed, i), accept, mode); | ||
| } | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => (status = accept(element)); | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| iterateIt(elementsOf(indexed, i), subProcess, mode); | ||
| if (status === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapArray$(array, elementsOf) { | ||
| return makePushIterable(flatMapIndexed$(array, elementsOf)); | ||
| } | ||
| function flatMapArray$defaultElementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| /** | ||
| * Returns a {@link PushIterator push iterator} without elements. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * | ||
| * @returns Empty push iterator instance. | ||
| */ | ||
| function overNone() { | ||
| return PushIterator$empty; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over one value. | ||
| * | ||
| * @typeParam T - Iterated element value type. | ||
| * @param value - A value to iterate over. | ||
| * | ||
| * @returns New push iterable over the given value. | ||
| */ | ||
| function overOne(value) { | ||
| return makePushIterable(iterateOverOneValue(value)); | ||
| } | ||
| function iterateOverOneValue(value) { | ||
| return accept => { | ||
| if (accept) { | ||
| accept(value); | ||
| return PushIterator$empty; | ||
| } | ||
| let over = false; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| if (over) { | ||
| return PushIterator$empty; | ||
| } | ||
| if (accept) { | ||
| over = true; | ||
| accept(value); | ||
| return PushIterator$empty; | ||
| } | ||
| return this; | ||
| }, | ||
| next() { | ||
| if (over) { | ||
| return { done: over }; | ||
| } | ||
| over = true; | ||
| return { value }; | ||
| }, | ||
| isOver: () => over, | ||
| }; | ||
| }; | ||
| } | ||
| function flatMapArray(array, convert) { | ||
| return flatMapArray$(array, convert ? (array, index) => convert(array[index]) : flatMapArray$defaultElementOf); | ||
| } | ||
| function flatMapIt(source, convert = flatMapIt$defaultConverter) { | ||
| return makePushIterable((accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
| return isPushIterable(source) | ||
| ? flatMapIt$process(source, convert, accept, mode) | ||
| : flatMapIt$raw$process(source, convert, accept, mode); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? flatMapIt$(source, convert) | ||
| : flatMapIt$raw(source, convert); | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function flatMapIt$(source, convert) { | ||
| let subs; | ||
| let lastSrc = false; | ||
| return accept => { | ||
| for (;;) { | ||
| while (!subs) { | ||
| const sourceTail = source[PushIterator__symbol](src => { | ||
| subs = convert(src); | ||
| return true; | ||
| }); | ||
| source = sourceTail; | ||
| if (sourceTail.isOver()) { | ||
| if (!subs) { | ||
| return false; | ||
| } | ||
| lastSrc = true; | ||
| } | ||
| } | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => (status = accept(element))); | ||
| if (subsTail.isOver()) { | ||
| subs = undefined; | ||
| if (lastSrc) { | ||
| return false; | ||
| } | ||
| } | ||
| else { | ||
| subs = subsTail; | ||
| } | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| function flatMapIt$raw(source, convert) { | ||
| const it = source[Symbol.iterator](); | ||
| if (isPushIterable(it)) { | ||
| return flatMapIt$(it, convert); | ||
| } | ||
| let subs; | ||
| return accept => { | ||
| for (;;) { | ||
| if (!subs) { | ||
| const next = it.next(); | ||
| if (next.done) { | ||
| return false; | ||
| } | ||
| subs = convert(next.value); | ||
| } | ||
| // eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => (status = accept(element))); | ||
| subs = subsTail.isOver() ? undefined : subsTail; | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| function flatMapIt$process(source, convert, accept, mode) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| source[PushIterator__symbol](src => iterateIt(convert(src), accept, mode)); | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => (status = accept(element)); | ||
| source[PushIterator__symbol]((src) => { | ||
| iterateIt(convert(src), subProcess, mode); | ||
| if (status === false) { | ||
| return false; | ||
| } | ||
| }); | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapIt$raw$process(source, convert, accept, mode) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| for (const src of source) { | ||
| iterateIt(convert(src), accept, mode); | ||
| } | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => (status = accept(element)); | ||
| for (const src of source) { | ||
| iterateIt(convert(src), subProcess, mode); | ||
| if (status === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapIt$defaultConverter(element) { | ||
| return element; | ||
| } | ||
| export { PushIterator__symbol as P, arrayLike$iterate as a, PushIterator$empty as b, iterator$convert as c, iterator$pusher as d, flatMapArray$defaultElementOf as e, flatMapArray$ as f, indexed$iterate as g, indexed$itemOf as h, isPushIterable as i, overNone as j, PushIterator$iterator as k, PushIterator$dontIterate as l, makePushIterable as m, PushIterator$noNext as n, overOne as o, iterateIt as p, indexed$process as q, arrayLike$elementOf as r, iterable$process as s, makePushIterator as t, flatMapIndexed$ as u, flatMapArray as v, flatMapIt as w }; | ||
| //# sourceMappingURL=flat-map-it-79cb7cb7.js.map |
| {"version":3,"file":"flat-map-it-79cb7cb7.js","sources":["../src/push-iterable.ts","../src/base/is-push-iterable.ts","../src/base/make-push-iterable.ts","../src/base/push-iterator.impl.ts","../src/base/push-iterator.empty.impl.ts","../src/base/make-push-iterator.ts","../src/base/indexed.impl.ts","../src/base/array-like.impl.ts","../src/base/iterable.impl.ts","../src/base/iterator.impl.ts","../src/base/iterate-it.ts","../src/transformation/flat-map-indexed.impl.ts","../src/transformation/flat-map-array.impl.ts","../src/construction/over-none.ts","../src/construction/over-one.ts","../src/transformation/flat-map-array.ts","../src/transformation/flat-map-it.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"AAGA;;AAEG;AACU,MAAA,oBAAoB,iBAAiB,MAAM,CAAC,eAAe;;ACoBlE,SAAU,cAAc,CAC5B,QAAmC,EAAA;AAEnC,IAAA,OAAO,CAAC,CAAE,QAAqC,CAAC,oBAAoB,CAAC,CAAC;AACxE;;AC3BA;;;;;;;AAOG;AACG,SAAU,gBAAgB,CAAI,OAAgC,EAAA;IAClE,OAAO;AACL,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,qBAAqB;QACxC,CAAC,oBAAoB,GAAG,OAAO;KAChC,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,GAAA;AAC5B,IAAA,OAAO,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;AACtC;;SChBgB,qBAAqB,GAAA;AACnC,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;SAEe,iBAAiB,GAAA;IAC/B,SAAS;AACP,QAAA,IAAI,MAA0C,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC,KAAK,IAAG;AA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B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAElF,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YAC1C,IAAI,MAAM,KAAK,KAAK,EAAE;gBACpB,MAAM;AACP,aAAA;AACF,SAAA;AACF,KAAA;AAED,IAAA,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,SAAS,0BAA0B,CAAW,OAAU,EAAA;AACtD,IAAA,OAAO,OAAqC,CAAC;AAC/C;;;;"} |
| /// <reference lib="dom" /> | ||
| /// <reference lib="es2019" /> | ||
| /// <reference path="push-iterator.d.ts" /> | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import type { CallChain, NextCall, NextSkip } from "@proc7ts/call-thru"; | ||
| /** | ||
| * A call chain transforming elements of iterable. | ||
| * | ||
| * Transformations performed when transformed element requested from final iterable. | ||
| */ | ||
| export interface IterableCallChain extends CallChain { | ||
| /** | ||
| * Calls a pass in this chain with each element of the given iterable. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param pass - A pass to call. | ||
| * @param iterable - Source iterable. | ||
| */ | ||
| iterate<T>(pass: (this: void, arg: T) => any, iterable: Iterable<T>): void; | ||
| } | ||
| export namespace IterableCallChain { | ||
| type Args<TReturn> = TReturn extends NextSkip<any> ? never : TReturn extends NextCall<IterableCallChain, infer A, any> ? A : [ | ||
| TReturn | ||
| ]; | ||
| type Out<TReturn> = TReturn extends NextSkip<any> ? never : TReturn extends NextCall<IterableCallChain, any, infer A> ? A : TReturn; | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import { NextCall } from "@proc7ts/call-thru"; | ||
| /** | ||
| * Creates a next call in {@link IterableCallChain | iterable call chain} that performs the next passes for each | ||
| * element of the given iterable. | ||
| * | ||
| * This call passes elements to the next call on demand, while the `nextEach()` one transforms them all at once, | ||
| * and iterates over results after that. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable containing elements to pass down the chain. | ||
| * | ||
| * @returns Next call for iterable call chain. | ||
| */ | ||
| export function nextIterate<T>(iterable: Iterable<T>): NextCall<IterableCallChain, [ | ||
| T | ||
| ], T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import type { PushIterable } from "@proc7ts/push-iterator"; | ||
| type Args<TReturn> = IterableCallChain.Args<TReturn>; | ||
| type Out<TReturn> = IterableCallChain.Out<TReturn>; | ||
| /** | ||
| * Passes each element of the given iterable trough the {@link IterableCallChain | chain of transformation passes}. | ||
| * | ||
| * The passes are preformed by `@proc7ts/call-thru`. | ||
| * | ||
| * @returns An push iterable of transformed elements. | ||
| */ | ||
| export function thruIt<T, TReturn1>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1): PushIterable<Out<TReturn1>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2): PushIterable<Out<TReturn2>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3): PushIterable<Out<TReturn3>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11, TArgs12 extends Args<TReturn11>, TReturn12>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11, pass12: (this: void, ...args: TArgs12) => TReturn12): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11, TArgs12 extends Args<TReturn11>, TReturn12, TArgs13 extends Args<TReturn12>, TReturn13>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11, pass12: (this: void, ...args: TArgs12) => TReturn12, pass13: (this: void, ...args: TArgs13) => TReturn13): PushIterable<Out<TReturn4>>; | ||
| } | ||
| //# sourceMappingURL=push-iterator.call-thru.d.ts.map |
| {"version":3,"sources":["src/call-thru/iterable-call-chain.ts","src/call-thru/next-iterate.ts","src/call-thru/thru-it.ts"],"names":[],"mappings":";;;;IAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,2BAA2B;;;;;;IAOxE,MAAM,WAAW,iBAAkB,CAAA,QAAQ,SAAS;;;;;;;;QAQlD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;KAC5E;IAED,MAAM,WAAW,iBAAiB,CAAC;QACjC,KAAY,IAAI,CAAC,OAAO,IAAI,OAAO,SAAS,QAAQ,CAAC,GAAG,CAAC,GACrD,KAAK,GACL,OAAO,SAAS,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GACzD,CAAC,GACD;YAAC,OAAO;SAAC,CAAC;QAEd,KAAY,GAAG,CAAC,OAAO,IAAI,OAAO,SAAS,QAAQ,CAAC,GAAG,CAAC,GACpD,KAAK,GACL,OAAO,SAAS,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,GACzD,CAAC,GACD,OAAO,CAAC;KACb;;;;IC9BD,OAAO,EAAE,QAAQ,EAAY,2BAA2B;;;;;;;;;;;;;IAexD,MAAM,UAAU,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,iBAAiB,EAAE;QAAC,CAAC;KAAC,EAAE,CAAC,CAAC,CAEzF;;;;ICfD,OAAO,KAAK,EAAE,YAAY,EAAE,+BAA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E,GAAG,IAAI,EAAE,MAAM,KAAK,QAAQ,EAChD,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,MAAM,KAAK,QAAQ,EAChD,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,MAAM,KAAK,QAAQ,EAChD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,KAAK,SAAS,EACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,KAAK,SAAS,EACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,KAAK,SAAS,EACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,KAAK,SAAS,GAClD,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC","file":"push-iterator.call-thru.d.ts","sourceRoot":".."} |
| /// <reference lib="dom" /> | ||
| /// <reference lib="es2019" /> | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Push iteration mode. | ||
| * | ||
| * This is a hint passed as second argument of {@link PushIterator__symbol} method. It declares what | ||
| * {@link PushIterator.Acceptor element acceptor} shall do, and can be used to optimize the iteration algorithm. | ||
| */ | ||
| export const enum PushIterationMode { | ||
| /** | ||
| * Push the next element if exists, then suspend or abort. | ||
| * | ||
| * This value is typically set in compatibility mode. I.e. when standard iterator used to iterate over push iterator. | ||
| */ | ||
| Next = 1, | ||
| /** | ||
| * Push some elements. Iteration may be suspended or aborted at any moment. | ||
| * | ||
| * This iteration mode is used by default. | ||
| */ | ||
| Some = 0, | ||
| /** | ||
| * Push only some subset of elements, then abort iteration. | ||
| * | ||
| * The {@link PushIterator.Acceptor element acceptor} shall not suspend iteration by returning `true` value in this | ||
| * mode. | ||
| */ | ||
| Only = 1, | ||
| /** | ||
| * Push all elements. | ||
| * | ||
| * The {@link PushIterator.Acceptor element acceptor} shall not suspend or abort iteration by returning boolean value | ||
| * in this mode. | ||
| */ | ||
| All = 2 | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Iterator implementing push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| export interface PushIterator<T> extends IterableIterator<T>, PushIterable<T> { | ||
| [Symbol.iterator](): PushIterator<T>; | ||
| /** | ||
| * Checks whether iteration is over. | ||
| * | ||
| * @returns `true` is there is nothing to iterate any more, or `false` if iteration is still possible. | ||
| */ | ||
| isOver(): boolean; | ||
| } | ||
| export namespace PushIterator { | ||
| /** | ||
| * A signature of iterated elements pusher function conforming to push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `false` to stop iteration. | ||
| * | ||
| * @returns `true` if further iteration is possible, or `false` if there is no more elements left to iterate. | ||
| * The latter is possible only when iteration aborted, i.e. `accept` returned `false`. | ||
| */ | ||
| type Pusher<T> = (this: void, accept: Acceptor<T>) => boolean; | ||
| /** | ||
| * A signature of a function accepting iterated elements. | ||
| * | ||
| * It is able to suspend iteration by returning `true`, or to stop it by returning `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| type Acceptor<T> = EachAcceptor<T> | StoppingAcceptor<T>; | ||
| /** | ||
| * A signature of a function accepting each iterated element unconditionally. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param element - Iterated element. | ||
| */ | ||
| type EachAcceptor<T> = (this: void, element: T) => void; | ||
| /** | ||
| * A signature of a function accepting iterated elements and able to suspend or stop further iteration. | ||
| * | ||
| * When this function returns `true`, the iteration is suspended. I.e. the no more elements would be pushed to this | ||
| * function, but the iteration method (`[PushIterator__symbol]`) would return an iterator that can be used to resume | ||
| * iteration. | ||
| * | ||
| * When this function returns `false`, the iteration is stopped. I.e. the no more elements would be pushed to this | ||
| * function, and the iteration method (`[PushIterator__symbol]`) would return an empty iterator. I.e. the one with | ||
| * its {@link PushIterator.isOver} method always returning `true`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param element - Iterated element. | ||
| * | ||
| * @returns `true` to suspend iteration, or `false` to stop it. | ||
| */ | ||
| type StoppingAcceptor<T> = (this: void, element: T) => boolean; | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * A key of {@link PushIterable} iteration method. | ||
| */ | ||
| export const PushIterator__symbol: unique symbol; | ||
| /** | ||
| * An iterable implementing push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| export interface PushIterable<T> extends Iterable<T> { | ||
| /** | ||
| * Creates a {@link PushIterator | push iterator} over elements of this iterable. | ||
| * | ||
| * @returns New push iterator instance. | ||
| */ | ||
| [Symbol.iterator](): PushIterator<T>; | ||
| /** | ||
| * Iterates over elements of this push iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * Calling this method with `accept` parameter is a faster alternative to creating a push iterator and iterating with | ||
| * it. | ||
| * | ||
| * Calling this method without arguments is the same as calling `[Symbol.iterator]()` one. | ||
| * | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. Ignored without `accept` | ||
| * parameter. | ||
| * | ||
| * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| * won't be possible with returned iterator. | ||
| */ | ||
| [PushIterator__symbol](accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
| export namespace PushIterable { | ||
| /** | ||
| * A signature of function conforming to push iteration protocol. | ||
| * | ||
| * Used as `PushIterable[PushIterator__symbol]` method implementation when passed to {@link makePushIterable} | ||
| * function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. Ignored without `accept` | ||
| * parameter. | ||
| * | ||
| * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| * won't be possible with returned iterator. | ||
| */ | ||
| type Iterate<T> = (this: void, accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode) => PushIterator<T>; | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Checks whether the given iterable conforms to {@link PushIterable | push iteration protocol}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to check. | ||
| * | ||
| * @returns `true` if the given `iterable` has a {@link PushIterator__symbol [PushIterator__symbol]} property, | ||
| * or `false` otherwise. | ||
| */ | ||
| export function isPushIterable<T>(iterable: Iterable<T>): iterable is PushIterable<T>; | ||
| /** | ||
| * Checks whether the given iterator conforms to {@link PushIterable | push iteration protocol}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterator - An iterator to check. | ||
| * | ||
| * @returns `true` if the given `iterator` has a {@link PushIterator__symbol | [PushIterator__symbol]} property, | ||
| * or `false` otherwise. | ||
| */ | ||
| export function isPushIterable<T>(iterator: Iterator<T>): iterator is PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterator over elements of the given push `iterable`. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - A push iterable to construct iterator of. | ||
| * | ||
| * @returns Push iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: PushIterable<T>): PushIterator<T>; | ||
| /** | ||
| * Creates an iterable iterator over elements of the given `iterable` supporting iterable iteration. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - A push iterable to construct iterator of. | ||
| * | ||
| * @returns Iterable iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: { | ||
| [Symbol.iterator](): IterableIterator<T>; | ||
| }): IterableIterator<T>; | ||
| /** | ||
| * Creates iterator over elements of the given `iterable`. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to construct iterator of. | ||
| * | ||
| * @returns Either push or raw iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: Iterable<T>): Iterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterable implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function iterating over iterable elements conforming to {@link PushIterable.Iterate} requirements. | ||
| * | ||
| * @returns New push iterable instance performing iteration by `forNext` function. | ||
| */ | ||
| export function makePushIterable<T>(iterate: PushIterable.Iterate<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterator implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param forNext - A function iterating over elements conforming to push iteration protocol. | ||
| * | ||
| * @returns New push iterator instance performing iteration by `forNext` function. | ||
| */ | ||
| export function makePushIterator<T>(forNext: PushIterator.Pusher<T>): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of array-like structure. | ||
| * | ||
| * @typeParam T - Array elements type. | ||
| * @param array - An array-like structure. E.g. `Array`, DOM `NodeList`, etc. | ||
| * | ||
| * @returns New push iterable over array elements. | ||
| */ | ||
| export function overArray<T>(array: ArrayLike<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Iterates over elements of the given iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate elements of. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
| * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| * iteration with, unless `accept` returned `false`. In the latter case the further iteration won't be possible. | ||
| */ | ||
| export function iterateIt<T>(iterable: Iterable<T>, accept: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of iterator created by the given function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function creating new iterator. | ||
| * | ||
| * @returns New push iterable over elements of created iterator. | ||
| */ | ||
| export function overIterator<T>(iterate: (this: void) => Iterator<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of the given raw iterable. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate over elements of. | ||
| * | ||
| * @returns New push iterable over elements of the given `iterable`. | ||
| */ | ||
| export function overIterable<T>(iterable: Iterable<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of other iterables. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param sources - Source iterables to iterate over elements of. | ||
| * | ||
| * @returns New push iterable over elements of the given `sources`. | ||
| */ | ||
| export function overElementsOf<T>(...sources: readonly Iterable<T>[]): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * An indexed list of items. | ||
| * | ||
| * @typeParam T - Indexed item value. | ||
| */ | ||
| export interface IndexedItemList<T> { | ||
| /** | ||
| * The length of the list. I.e. the number of items it contains. | ||
| */ | ||
| readonly length: number; | ||
| /** | ||
| * Retrieves an item under the given index. | ||
| * | ||
| * @param index - Item index. | ||
| * | ||
| * @returns Either item value, or `null`/`undefined` if there is no item with such index, i.e. if the index is not | ||
| * an integer value, is negative, or greater or equal to the {@link length}. | ||
| */ | ||
| item(index: number): T | null | undefined; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over items of {@link IndexedItemList | indexed list}. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @param indexed - An indexed list of items. E.g. DOM `NodeList`. | ||
| * | ||
| * @returns New push iterable over list items. | ||
| */ | ||
| export function overIndexed<T>(indexed: IndexedItemList<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Returns a {@link PushIterator push iterator} without elements. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * | ||
| * @returns Empty push iterator instance. | ||
| */ | ||
| export function overNone<T>(): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over one value. | ||
| * | ||
| * @typeParam T - Iterated element value type. | ||
| * @param value - A value to iterate over. | ||
| * | ||
| * @returns New push iterable over the given value. | ||
| */ | ||
| export function overOne<T>(value: T): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over many values. | ||
| * | ||
| * @typeParam T - Iterated elements value type. | ||
| * @param values - Values to iterate over. | ||
| * | ||
| * @returns New push iterable over the given values. | ||
| */ | ||
| export function overMany<T>(...values: readonly T[]): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of array-like structure in reverse order. | ||
| * | ||
| * @typeParam T - Array elements type. | ||
| * @param array - An array-like structure. E.g. `Array`, DOM `NodeList`, etc. | ||
| * | ||
| * @returns New push iterable over array elements in reverse order. | ||
| */ | ||
| export function reverseArray<T>(array: ArrayLike<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Performs the given `action` for each element of the given `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable of elements to perform actions on. | ||
| * @param action - An action to perform on each iterable element. This is a function accepting an element as its only | ||
| * parameter. | ||
| */ | ||
| export function itsEach<T>(iterable: Iterable<T>, action: (this: void, element: T) => void): void; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a new, shallow-copied array instance containing elements of the `source` iterable. | ||
| * | ||
| * Calling this function result to the same result as calling `Array.from(source)`, except it is optimized for | ||
| * {@link PushIterable push iterables}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param source - A source iterable to copy elements from. | ||
| * | ||
| * @returns New array of `source` elements. | ||
| */ | ||
| export function itsElements<T>(source: Iterable<T>): T[]; | ||
| /** | ||
| * Creates a new, shallow-copied array instance containing elements of the `source` iterable converted by the given | ||
| * converter function. | ||
| * | ||
| * Calling this function result to the same result as calling `Array.from(source, convert)`, except it is optimized for | ||
| * {@link PushIterable push iterables}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TConv - Resulting array elements type. | ||
| * @param source - A source iterable to convert elements from. | ||
| * @param convert - A function that produces an element of result array, taking element of `source` iterable as the only | ||
| * parameter. | ||
| * | ||
| * @returns New array of elements converted from `source` ones. | ||
| */ | ||
| export function itsElements<T, TConv>(source: Iterable<T>, convert: (this: void, element: T) => TConv): TConv[]; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Checks whether the given `iterable` is empty. | ||
| * | ||
| * @param iterable - An iterable or push iterable to check for elements. | ||
| * | ||
| * @returns `true` if the given iterable contains at least one element, or `false` otherwise. | ||
| */ | ||
| export function itsEmpty(iterable: Iterable<unknown>): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Tests whether all elements of the given `iterable` pass the test implemented by the provided function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to test elements of. | ||
| * @param test - A predicate function to test each element. Returns `true` to continue tests, or `false` to stop it | ||
| * and return `false` from the method call. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns `true` if the `test` function returned a truthy value for every element, or `false` otherwise. | ||
| * Returns `true` for empty iterable. | ||
| */ | ||
| export function itsEvery<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Searches for the value in `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TFound - Found value type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * @param search - A function extracting the value from elements. It is called for each iterated element until the value | ||
| * found. Accepts element as the only parameter, and returns extracted value. If returns `false` or `undefined` the | ||
| * search continues from the next element. | ||
| * | ||
| * @returns Either found value or `undefined`. | ||
| */ | ||
| export function itsFind<T, TFound>(iterable: Iterable<T>, search: (this: void, element: T) => TFound | false | undefined): TFound | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Extracts the first element of the given `iterable`, if any. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * | ||
| * @returns Either the first element, or `undefined` if the given `iterable` is empty. | ||
| */ | ||
| export function itsFirst<T>(iterable: Iterable<T>): T | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Starts iteration over the given `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable or push iterable to iterate over. | ||
| * | ||
| * @returns A push iterator iterating over the given iterable. | ||
| */ | ||
| export function itsIterator<T>(iterable: Iterable<T>): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Extracts the first element matching the given condition from `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * @param test - A predicate function to test elements. Returns truthy value for matching one. It accepts the tested | ||
| * element as the only parameter. | ||
| * | ||
| * @returns Either the matching element, or `undefined` if no elements match. | ||
| */ | ||
| export function itsMatch<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): T | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Applies a function against an accumulator and each element of the given `iterable` to reduce elements to a single | ||
| * value. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TResult - A type of reduced value. | ||
| * @param iterable - An iterable to reduce values of. | ||
| * @param reducer - A function to apply the value returned from the previous `reducer` call and to each element. | ||
| * @param initialValue - Initial value passed to the first `reducer` call. | ||
| * | ||
| * @returns Reduced value returned from the last `reducer` call, or `initialValue` if there is no elements in the given | ||
| * `iterable`. | ||
| */ | ||
| export function itsReduction<T, TResult>(iterable: Iterable<T>, reducer: (this: void, prev: TResult, element: T) => TResult, initialValue: TResult): TResult; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Tests whether at least one element of the given `iterable` passes the test implemented by the provided function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to test elements of. | ||
| * @param test - A predicate function to test each element. Returns `false` to continue tests, or `true` to stop it | ||
| * and return `true` from the method call. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns `true` if the callback function returned a truthy value for at least one element in the array, or `false` | ||
| * otherwise. Returns `false` for empty iterable. | ||
| */ | ||
| export function itsSome<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Object property entry. | ||
| * | ||
| * This is a tuple consisting of property key and value. | ||
| * | ||
| * @typeParam TObj - Object type. | ||
| * @typeParam TKey - A type of object property keys. | ||
| */ | ||
| export type ObjectEntry<TObj, TKey extends keyof TObj = keyof TObj> = readonly [ | ||
| TKey, | ||
| TObj[TKey] | ||
| ]; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over keys of the given object. | ||
| * | ||
| * A list of keys is constructed using `Reflect.ownKeys()`. | ||
| * | ||
| * @typeParam TObj - Source object type. | ||
| * @param source - An object to select keys from. | ||
| * | ||
| * @returns New push iterable over own object keys retrieved by `Reflect.ownKeys()`. | ||
| */ | ||
| export function overKeys<TObj extends object>(source: TObj): PushIterable<keyof TObj>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable push iterable} with all `array` elements extending the given type. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @typeParam TTarget - Target type. | ||
| * @param array - A source array. | ||
| * @param test - A predicate function to test that element extends the type `TTarget`. Returns `true` to keep the | ||
| * element, or `false` otherwise. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterArray<T, TTarget extends T>(array: ArrayLike<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `array` elements that pass the test implemented by | ||
| * the provided function. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @param array - A source array. | ||
| * @param test - A predicate function to test each element. Returns `true` to keep the element, or `false` otherwise. | ||
| * It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterArray<T>(array: ArrayLike<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all items of the given indexed list that extend the given type. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @typeParam TTarget - Target type. | ||
| * @param indexed - A source indexed items list. | ||
| * @param test - A predicate function to test that item extends the type `TTarget`. Returns `true` to keep the element, | ||
| * or `false` otherwise. It accepts the tested item as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIndexed<T, TTarget extends T>(indexed: IndexedItemList<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all items of the given indexed list that pass the test | ||
| * implemented by the provided function. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @param indexed - A source indexed items list. | ||
| * @param test - A predicate function to test each item. Returns `true` to keep the item, or `false` otherwise. | ||
| * It accepts the tested item as the only parameter. | ||
| * | ||
| * @returns New push iterable with the items that pass the test. If no items passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIndexed<T>(indexed: IndexedItemList<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `source` iterable elements extending the given type. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @typeParam TTarget - Target type. | ||
| * @param source - A source iterable. | ||
| * @param test - A predicate function to test that element extends the type `TTarget`. Returns `true` to keep the | ||
| * element, or`false` otherwise. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIt<T, TTarget extends T>(source: Iterable<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `source` iterable elements that pass the test implemented by | ||
| * the provided function. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @param source - A source iterable. | ||
| * @param test - A predicate function to test each element. Returns `true` to keep the element, or `false` otherwise. | ||
| * It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIt<T>(source: Iterable<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source `array` of iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapArray(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param array - A source array-like instance of iterables. | ||
| * | ||
| * @returns New push iterable with each element of `array` being flattened. | ||
| */ | ||
| export function flatMapArray<T>(array: ArrayLike<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each element of the source `array` using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of array elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param array - A source array-like instance of elements to convert. | ||
| * @param convert - A function that produces new iterable, taking array element as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapArray<TSrc, TConv>(array: ArrayLike<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source list of indexed iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapIndexed(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param indexed - A source list of indexed iterables. | ||
| * | ||
| * @returns New push iterable with each element of indexed list being flattened. | ||
| */ | ||
| export function flatMapIndexed<T>(indexed: IndexedItemList<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each item of the source indexed list using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of indexed items. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param indexed - A source list of indexed items to convert. | ||
| * @param convert - A function that produces new iterable, taking the list item as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapIndexed<TSrc, TConv>(indexed: IndexedItemList<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source iterable of iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapIt(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param source - A source iterable of iterables. | ||
| * | ||
| * @returns New push iterable with each element of `source` being flattened. | ||
| */ | ||
| export function flatMapIt<T>(source: Iterable<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each element of the `source` iterable using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of source elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param source - A source iterable of elements to convert. | ||
| * @param convert - A function that produces new iterable, taking the source element as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapIt<TSrc, TConv>(source: Iterable<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every element | ||
| * of the given `array`. | ||
| * | ||
| * @typeParam TSrc - A type of array elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param array - A source array-like instance. | ||
| * @param convert - A function that produces an element of new iterable, taking array element as the only parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapArray<TSrc, TConv>(array: ArrayLike<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every item of the | ||
| * given indexed list. | ||
| * | ||
| * @typeParam TSrc - A type of indexed list items. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param indexed - A source indexed items list. | ||
| * @param convert - A function that produces an element of new iterable, taking list item as the only parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapIndexed<TSrc, TConv>(indexed: IndexedItemList<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every element | ||
| * of the `source` iterable. | ||
| * | ||
| * @typeParam TSrc - A type of source elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param source - A source iterable. | ||
| * @param convert - A function that produces an element of the new iterable, taking the source element as the only | ||
| * parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapIt<TSrc, TConv>(source: Iterable<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of elements of the given `array`. | ||
| * | ||
| * Element value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered | ||
| * out. | ||
| * | ||
| * This can be used as a more effective {@link mapArray} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @typeParam TValue - A type of array element values. | ||
| * @param array - A source array. | ||
| * @param valueOf - A function that values elements, taking the source element as the only parameter, and returning | ||
| * either its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with array element values. | ||
| */ | ||
| export function valueArray<T, TValue = T>(array: ArrayLike<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of items of the given indexed list. | ||
| * | ||
| * Item value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered out. | ||
| * | ||
| * This can be used as a more effective {@link mapIndexed} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @typeParam TValue - A type of item values. | ||
| * @param indexed - A source indexed items list. | ||
| * @param valueOf - A function that values items, taking the source item as the only parameter, and returning either | ||
| * its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with the item values. | ||
| */ | ||
| export function valueIndexed<T, TValue = T>(indexed: IndexedItemList<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of elements of the `source` iterable. | ||
| * | ||
| * Element value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered | ||
| * out. | ||
| * | ||
| * This can be used as a more effective {@link mapIt} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @typeParam TValue - A type of source element values. | ||
| * @param source - A source iterable. | ||
| * @param valueOf - A function that values elements, taking the source element as the only parameter, and returning | ||
| * either its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with the element values. | ||
| */ | ||
| export function valueIt<T, TValue = T>(source: Iterable<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over the property key/value entries of the given object. | ||
| * | ||
| * A list of keys is constructed using `Reflect.ownKeys()`. | ||
| * | ||
| * @typeParam TObj - Object type. | ||
| * | ||
| * @param source - An object to select keys and values from. | ||
| * | ||
| * @returns New push iterable of object property entries. | ||
| */ | ||
| export function overEntries<TObj extends object>(source: TObj): PushIterable<ObjectEntry<TObj>>; | ||
| } | ||
| //# sourceMappingURL=push-iterator.d.ts.map |
| {"version":3,"sources":["src/push-iteration-mode.ts","src/push-iterator.ts","src/push-iterable.ts","src/base/is-push-iterable.ts","src/base/iterator-of.ts","src/base/make-push-iterable.ts","src/base/make-push-iterator.ts","src/construction/over-array.ts","src/base/iterate-it.ts","src/construction/over-iterator.ts","src/construction/over-iterable.ts","src/construction/over-elements-of.ts","src/construction/over-indexed.ts","src/construction/over-none.ts","src/construction/over-one.ts","src/construction/over-many.ts","src/construction/reverse-array.ts","src/consumption/its-each.ts","src/consumption/its-elements.ts","src/consumption/its-empty.ts","src/consumption/its-every.ts","src/consumption/its-find.ts","src/consumption/its-first.ts","src/consumption/its-iterator.ts","src/consumption/its-match.ts","src/consumption/its-reduction.ts","src/consumption/its-some.ts","src/objects/object-entry.ts","src/objects/over-keys.ts","src/transformation/filter-array.ts","src/transformation/filter-indexed.ts","src/transformation/filter-it.ts","src/transformation/flat-map-array.ts","src/transformation/flat-map-indexed.ts","src/transformation/flat-map-it.ts","src/transformation/map-array.ts","src/transformation/map-indexed.ts","src/transformation/map-it.ts","src/transformation/value-array.ts","src/transformation/value-indexed.ts","src/transformation/value-it.ts","src/objects/over-entries.ts"],"names":[],"mappings":";;;;;;;;;IAMA,MAAM,YAAY,iBAAiB;;;;;;QAMjC,IAAI,GAAA,CAAI;;;;;;QAOR,IAAI,GAAA,CAAI;;;;;;;QAQR,IAAI,GAAA,CAAI;;;;;;;QAQR,GAAG,GAAA,CAAI;KACR;;;;;;;;;IC7BD,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,QAAQ,gBAAgB,GAAG,iBAAiB;QAC3E,CAAC,MAAM,SAAS,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;;;;;;QAOrC,MAAM,IAAI,OAAO,CAAC;KACnB;IAED,MAAM,WAAW,YAAY,CAAC;;;;;;;;;;;QAW5B,KAAY,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,KAA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,SAAS,GACrE,YAAY,CAAC,MAAM,CAAC,CAoBtB;;;;;;;;;;;;;;;IC/BD,MAAM,UAAU,WAAW,CAAC,IAAI,SAAS,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAE9F","file":"push-iterator.d.ts","sourceRoot":".."} |
| import { nextCall, isNextCall, NextCall__symbol } from '@proc7ts/call-thru'; | ||
| import { flatMapIt, flatMapArray, overOne } from './push-iterator.js'; | ||
| import { v as flatMapArray, w as flatMapIt, o as overOne } from './flat-map-it-79cb7cb7.js'; | ||
@@ -24,3 +24,7 @@ /** | ||
| ++index; | ||
| const pass = index < passes.length ? passes[index] : () => { }; | ||
| const pass = index < passes.length | ||
| ? passes[index] | ||
| : () => { | ||
| /* empty pass */ | ||
| }; | ||
| const handleResult = (outcome, callResult, arg) => { | ||
@@ -37,3 +41,3 @@ if (isNextCall(callResult)) { | ||
| }; | ||
| return ({ | ||
| return { | ||
| call(fn, args) { | ||
@@ -45,3 +49,5 @@ handleResult(outcome, fn(...args), args); | ||
| }, | ||
| skip() { }, | ||
| skip() { | ||
| /* skip item */ | ||
| }, | ||
| iterate(fn, iterable) { | ||
@@ -54,3 +60,3 @@ outcome.push(flatMapIt(iterable, item => { | ||
| }, | ||
| }); | ||
| }; | ||
| }; | ||
@@ -57,0 +63,0 @@ const finalOutcome = []; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"push-iterator.call-thru.js","sources":["../src/call-thru/next-iterate.ts","../src/call-thru/thru-it.ts"],"sourcesContent":["import { NextCall, nextCall } from '@proc7ts/call-thru';\nimport type { IterableCallChain } from './iterable-call-chain';\n\n/**\n * Creates a next call in {@link IterableCallChain | iterable call chain} that performs the next passes for each\n * element of the given iterable.\n *\n * This call passes elements to the next call on demand, while the `nextEach()` one transforms them all at once,\n * and iterates over results after that.\n *\n * @typeParam T - Iterated elements type.\n * @param iterable - An iterable containing elements to pass down the chain.\n *\n * @returns Next call for iterable call chain.\n */\nexport function nextIterate<T>(iterable: Iterable<T>): NextCall<IterableCallChain, [T], T> {\n return nextCall((chain, pass) => chain.iterate(pass, iterable));\n}\n","import { isNextCall, NextCall__symbol } from '@proc7ts/call-thru';\nimport { overOne } from '../construction';\nimport type { PushIterable } from '../push-iterable';\nimport { flatMapArray, flatMapIt } from '../transformation';\nimport type { IterableCallChain } from './iterable-call-chain';\n\ntype Args<TReturn> = IterableCallChain.Args<TReturn>;\ntype Out<TReturn> = IterableCallChain.Out<TReturn>;\n\n/**\n * Passes each element of the given iterable trough the {@link IterableCallChain | chain of transformation passes}.\n *\n * The passes are preformed by `@proc7ts/call-thru`.\n *\n * @returns An push iterable of transformed elements.\n */\nexport function thruIt<\n T, TReturn1\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n): PushIterable<Out<TReturn1>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n): PushIterable<Out<TReturn2>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n): PushIterable<Out<TReturn3>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n TArgs9 extends Args<TReturn8>, TReturn9,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n pass9: (this: void, ...args: TArgs9) => TReturn9,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n TArgs9 extends Args<TReturn8>, TReturn9,\n TArgs10 extends Args<TReturn9>, TReturn10,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n pass9: (this: void, ...args: TArgs9) => TReturn9,\n pass10: (this: void, ...args: TArgs10) => TReturn10,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n TArgs9 extends Args<TReturn8>, TReturn9,\n TArgs10 extends Args<TReturn9>, TReturn10,\n TArgs11 extends Args<TReturn10>, TReturn11,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n pass9: (this: void, ...args: TArgs9) => TReturn9,\n pass10: (this: void, ...args: TArgs10) => TReturn10,\n pass11: (this: void, ...args: TArgs11) => TReturn11,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n TArgs9 extends Args<TReturn8>, TReturn9,\n TArgs10 extends Args<TReturn9>, TReturn10,\n TArgs11 extends Args<TReturn10>, TReturn11,\n TArgs12 extends Args<TReturn11>, TReturn12,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n pass9: (this: void, ...args: TArgs9) => TReturn9,\n pass10: (this: void, ...args: TArgs10) => TReturn10,\n pass11: (this: void, ...args: TArgs11) => TReturn11,\n pass12: (this: void, ...args: TArgs12) => TReturn12,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<\n T, TReturn1,\n TArgs2 extends Args<TReturn1>, TReturn2,\n TArgs3 extends Args<TReturn2>, TReturn3,\n TArgs4 extends Args<TReturn3>, TReturn4,\n TArgs5 extends Args<TReturn4>, TReturn5,\n TArgs6 extends Args<TReturn5>, TReturn6,\n TArgs7 extends Args<TReturn6>, TReturn7,\n TArgs8 extends Args<TReturn7>, TReturn8,\n TArgs9 extends Args<TReturn8>, TReturn9,\n TArgs10 extends Args<TReturn9>, TReturn10,\n TArgs11 extends Args<TReturn10>, TReturn11,\n TArgs12 extends Args<TReturn11>, TReturn12,\n TArgs13 extends Args<TReturn12>, TReturn13,\n >(\n it: Iterable<T>,\n pass1: (this: void, arg: T) => TReturn1,\n pass2: (this: void, ...args: TArgs2) => TReturn2,\n pass3: (this: void, ...args: TArgs3) => TReturn3,\n pass4: (this: void, ...args: TArgs4) => TReturn4,\n pass5: (this: void, ...args: TArgs5) => TReturn5,\n pass6: (this: void, ...args: TArgs6) => TReturn6,\n pass7: (this: void, ...args: TArgs7) => TReturn7,\n pass8: (this: void, ...args: TArgs8) => TReturn8,\n pass9: (this: void, ...args: TArgs9) => TReturn9,\n pass10: (this: void, ...args: TArgs10) => TReturn10,\n pass11: (this: void, ...args: TArgs11) => TReturn11,\n pass12: (this: void, ...args: TArgs12) => TReturn12,\n pass13: (this: void, ...args: TArgs13) => TReturn13,\n): PushIterable<Out<TReturn4>>;\n\nexport function thruIt<T, TReturn>(\n it: Iterable<T>,\n ...passes: ((...args: any[]) => any)[]\n): PushIterable<TReturn> {\n\n const chain = (outcome: PushIterable<any>[], index: number): IterableCallChain => {\n\n const lastPass = index >= passes.length;\n\n ++index;\n\n const pass = index < passes.length ? passes[index] : () => { /* empty pass */ };\n const handleResult = (outcome: PushIterable<any>[], callResult: any, arg: any): void => {\n if (isNextCall(callResult)) {\n callResult[NextCall__symbol](chain(outcome, index), pass);\n } else if (lastPass) {\n outcome.push(overOne(arg));\n } else {\n chain(outcome, index).pass(pass, callResult);\n }\n };\n\n return ({\n call<TArgs extends any[]>(fn: (...args: TArgs) => any, args: TArgs): void {\n handleResult(outcome, fn(...args), args);\n },\n pass<TArgs>(fn: (arg: TArgs) => any, arg: TArgs): void {\n handleResult(outcome, fn(arg), arg);\n },\n skip() {/* skip item */},\n iterate<TElement>(fn: (this: void, arg: TElement) => void, iterable: Iterable<TElement>): void {\n outcome.push(flatMapIt(\n iterable,\n item => {\n\n const itemOutcome: PushIterable<any>[] = [];\n\n handleResult(itemOutcome, fn(item), item);\n\n return flatMapArray(itemOutcome);\n },\n ));\n },\n });\n };\n\n const finalOutcome: PushIterable<any>[] = [];\n\n chain(finalOutcome, 0).iterate(passes[0], it);\n\n return flatMapArray<TReturn>(finalOutcome);\n}\n"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;SAYgB,WAAW,CAAI,QAAqB;IAClD,OAAO,QAAQ,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClE;;SCsPgB,MAAM,CAClB,EAAe,EACf,GAAG,MAAmC;IAGxC,MAAM,KAAK,GAAG,CAAC,OAA4B,EAAE,KAAa;QAExD,MAAM,QAAQ,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;QAExC,EAAE,KAAK,CAAC;QAER,MAAM,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,SAA0B,CAAC;QAChF,MAAM,YAAY,GAAG,CAAC,OAA4B,EAAE,UAAe,EAAE,GAAQ;YAC3E,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;gBAC1B,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;aAC3D;iBAAM,IAAI,QAAQ,EAAE;gBACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;aAC5B;iBAAM;gBACL,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;aAC9C;SACF,CAAC;QAEF,QAAQ;YACN,IAAI,CAAsB,EAA2B,EAAE,IAAW;gBAChE,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;aAC1C;YACD,IAAI,CAAQ,EAAuB,EAAE,GAAU;gBAC7C,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;aACrC;YACD,IAAI,MAAoB;YACxB,OAAO,CAAW,EAAuC,EAAE,QAA4B;gBACrF,OAAO,CAAC,IAAI,CAAC,SAAS,CAClB,QAAQ,EACR,IAAI;oBAEF,MAAM,WAAW,GAAwB,EAAE,CAAC;oBAE5C,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;oBAE1C,OAAO,YAAY,CAAC,WAAW,CAAC,CAAC;iBAClC,CACJ,CAAC,CAAC;aACJ;SACF,EAAE;KACJ,CAAC;IAEF,MAAM,YAAY,GAAwB,EAAE,CAAC;IAE7C,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE9C,OAAO,YAAY,CAAU,YAAY,CAAC,CAAC;AAC7C;;;;"} | ||
| {"version":3,"file":"push-iterator.call-thru.js","sources":["../src/call-thru/next-iterate.ts","../src/call-thru/thru-it.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;AAGA;;;;;;;;;;;AAWG;AACG,SAAU,WAAW,CAAI,QAAqB,EAAA;AAClD,IAAA,OAAO,QAAQ,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClE;;SCyUgB,MAAM,CACpB,EAAe,EACf,GAAG,MAA2C,EAAA;AAE9C,IAAA,MAAM,KAAK,GAAG,CAAC,OAAgC,EAAE,KAAa,KAAuB;AACnF,QAAA,MAAM,QAAQ,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;AAExC,QAAA,EAAE,KAAK,CAAC;AAER,QAAA,MAAM,IAAI,GACR,KAAK,GAAG,MAAM,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EAAE,CAAC;AAE7C,IAAA,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE9C,IAAA,OAAO,YAAY,CAAU,YAAY,CAAC,CAAC;AAC7C;;;;"} |
+47
-573
@@ -1,10 +0,4 @@ | ||
| /** | ||
| * A key of {@link PushIterable} iteration method. | ||
| */ | ||
| const PushIterator__symbol = ( /*#__PURE__*/Symbol('push-iterator')); | ||
| import { m as makePushIterable, a as arrayLike$iterate, i as isPushIterable, P as PushIterator__symbol, b as PushIterator$empty, c as iterator$convert, d as iterator$pusher, f as flatMapArray$, e as flatMapArray$defaultElementOf, g as indexed$iterate, h as indexed$itemOf, o as overOne, j as overNone, k as PushIterator$iterator, l as PushIterator$dontIterate, n as PushIterator$noNext, p as iterateIt, q as indexed$process, r as arrayLike$elementOf, s as iterable$process, t as makePushIterator, u as flatMapIndexed$ } from './flat-map-it-79cb7cb7.js'; | ||
| export { v as flatMapArray, w as flatMapIt } from './flat-map-it-79cb7cb7.js'; | ||
| function isPushIterable(iterable) { | ||
| return !!iterable[PushIterator__symbol]; | ||
| } | ||
| function iteratorOf(iterable) { | ||
@@ -15,168 +9,2 @@ return iterable[Symbol.iterator](); | ||
| /** | ||
| * Creates a push iterable implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function iterating over iterable elements conforming to {@link PushIterable.Iterate} requirements. | ||
| * | ||
| * @returns New push iterable instance performing iteration by `forNext` function. | ||
| */ | ||
| function makePushIterable(iterate) { | ||
| return { | ||
| [Symbol.iterator]: PushIterable$iterator, | ||
| [PushIterator__symbol]: iterate, | ||
| }; | ||
| } | ||
| function PushIterable$iterator() { | ||
| return this[PushIterator__symbol](); | ||
| } | ||
| function PushIterator$iterator() { | ||
| return this; | ||
| } | ||
| function PushIterator$next() { | ||
| for (;;) { | ||
| let result; | ||
| const tail = this[PushIterator__symbol](value => { | ||
| result = { value }; | ||
| return true; | ||
| }, 1 /* Next */); | ||
| if (result) { | ||
| return result; | ||
| } | ||
| if (tail.isOver()) { | ||
| return { done: true }; | ||
| } | ||
| } | ||
| } | ||
| const PushIterator$empty = { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](_accept, _mode) { | ||
| return this; | ||
| }, | ||
| next: PushIterator$noNext, | ||
| isOver: PushIterator$over, | ||
| }; | ||
| function PushIterator$noNext() { | ||
| return { done: true }; | ||
| } | ||
| function PushIterator$dontIterate(_accept, _mode) { | ||
| // Do not iterate | ||
| } | ||
| function PushIterator$over() { | ||
| return true; | ||
| } | ||
| /** | ||
| * Creates a push iterator implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param forNext - A function iterating over elements conforming to push iteration protocol. | ||
| * | ||
| * @returns New push iterator instance performing iteration by `forNext` function. | ||
| */ | ||
| function makePushIterator(forNext) { | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| } | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next: PushIterator$next, | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function indexed$itemOf(indexed, index) { | ||
| return indexed.item(index); // The index is always valid. | ||
| } | ||
| function indexed$process(indexed, elementOf, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* All */) { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| accept(elementOf(indexed, i)); | ||
| } | ||
| } | ||
| else { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| if (accept(elementOf(indexed, i)) === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function indexed$some(indexed, elementOf, accept) { | ||
| let i = 0; | ||
| const forNext = (accept) => { | ||
| if (i >= indexed.length) { | ||
| return false; | ||
| } | ||
| for (;;) { | ||
| const goOn = accept(elementOf(indexed, i++)); | ||
| if (i >= indexed.length || goOn === false) { | ||
| return false; | ||
| } | ||
| if (goOn === true) { | ||
| return true; | ||
| } | ||
| } | ||
| }; | ||
| if (accept && !forNext(accept)) { | ||
| return PushIterator$empty; | ||
| } | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
| } | ||
| }; | ||
| let next = () => { | ||
| if (i < indexed.length) { | ||
| return { value: elementOf(indexed, i++) }; | ||
| } | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| return { done: true }; | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next: () => next(), | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function indexed$iterate(indexed, elementOf) { | ||
| return (accept, mode = 0 /* Some */) => accept && mode > 0 | ||
| ? indexed$process(indexed, elementOf, accept, mode) | ||
| : indexed$some(indexed, elementOf, accept); | ||
| } | ||
| function arrayLike$elementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| function arrayLike$process(array, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| return indexed$process(array, arrayLike$elementOf, accept, mode); | ||
| } | ||
| function arrayLike$some(array, accept) { | ||
| return indexed$some(array, arrayLike$elementOf, accept); | ||
| } | ||
| function arrayLike$iterate(array) { | ||
| return indexed$iterate(array, arrayLike$elementOf); | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of array-like structure. | ||
@@ -193,169 +21,3 @@ * | ||
| function iterable$process(iterable, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* All */) { | ||
| for (const element of iterable) { | ||
| accept(element); | ||
| } | ||
| } | ||
| else { | ||
| for (const element of iterable) { | ||
| if (accept(element) === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function iterator$convert(it, forNext) { | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| if ((over = !!accept && !forNext(accept))) { | ||
| iterate = PushIterator$dontIterate; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
| } | ||
| }; | ||
| let next = () => { | ||
| const res = it.next(); | ||
| if (res.done) { | ||
| over = true; | ||
| iterate = PushIterator$dontIterate; | ||
| next = PushIterator$noNext; | ||
| } | ||
| return res; | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next() { | ||
| return next(); | ||
| }, | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| function iterator$pusher(it) { | ||
| return accept => { | ||
| for (;;) { | ||
| const res = it.next(); | ||
| if (res.done) { | ||
| return false; | ||
| } | ||
| const status = accept(res.value); | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| /** | ||
| * Iterates over elements of the given iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate elements of. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
| * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| * iteration with, unless `accept` returned `false`. In the latter case the further iteration won't be possible. | ||
| */ | ||
| function iterateIt(iterable, accept, mode = 0 /* Some */) { | ||
| if (isPushIterable(iterable)) { | ||
| return iterable[PushIterator__symbol](accept, mode); | ||
| } | ||
| if (Array.isArray(iterable)) { | ||
| return iterateIt$array(iterable, accept, mode); | ||
| } | ||
| return iterateIt$raw(iterable, accept, mode); | ||
| } | ||
| function iterateIt$array(array, accept, mode) { | ||
| return array.length | ||
| ? (mode > 0 ? arrayLike$process(array, accept, mode) : arrayLike$some(array, accept)) | ||
| : PushIterator$empty; | ||
| } | ||
| function iterateIt$raw(iterable, accept, mode) { | ||
| if (mode > 0) { | ||
| return iterable$process(iterable, accept, mode); | ||
| } | ||
| const it = iterable[Symbol.iterator](); | ||
| if (isPushIterable(it)) { | ||
| return it[PushIterator__symbol](accept, mode); | ||
| } | ||
| const forEach = iterator$pusher(it); | ||
| return forEach(accept) | ||
| ? iterator$convert(it, forEach) | ||
| : PushIterator$empty; | ||
| } | ||
| function flatMapIndexed$(indexed, elementsOf) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| return flatMapIndexed$process(indexed, elementsOf, accept, mode); | ||
| } | ||
| let i = 0; | ||
| let subs; | ||
| const forNext = (accept) => { | ||
| if (i >= indexed.length) { | ||
| return false; | ||
| } | ||
| if (!subs) { | ||
| subs = elementsOf(indexed, i); | ||
| } | ||
| for (;;) { | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => status = accept(element)); | ||
| if (subsTail.isOver()) { | ||
| if (++i >= indexed.length) { | ||
| return false; | ||
| } | ||
| subs = elementsOf(indexed, i); | ||
| } | ||
| else { | ||
| subs = subsTail; | ||
| } | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : makePushIterator(forNext); | ||
| }; | ||
| } | ||
| function flatMapIndexed$process(indexed, elementsOf, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* All */) { | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| iterateIt(elementsOf(indexed, i), accept, mode); | ||
| } | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => status = accept(element); | ||
| for (let i = 0; i < indexed.length; ++i) { | ||
| iterateIt(elementsOf(indexed, i), subProcess, mode); | ||
| if (status === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapArray$(array, elementsOf) { | ||
| return makePushIterable(flatMapIndexed$(array, elementsOf)); | ||
| } | ||
| function flatMapArray$defaultElementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of iterator created by the given function. | ||
@@ -372,3 +34,3 @@ * | ||
| function overIterator$iterate(iterate) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| const it = iterate(); | ||
@@ -379,5 +41,3 @@ if (isPushIterable(it)) { | ||
| const forNext = iterator$pusher(it); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : iterator$convert(it, forNext); | ||
| return accept && !forNext(accept) ? PushIterator$empty : iterator$convert(it, forNext); | ||
| }; | ||
@@ -411,3 +71,5 @@ } | ||
| ? flatMapArray$(sources, flatMapArray$defaultElementOf) | ||
| : (sources.length ? overIterable(sources[0]) : PushIterator$empty); | ||
| : sources.length | ||
| ? overIterable(sources[0]) | ||
| : PushIterator$empty; | ||
| } | ||
@@ -428,56 +90,2 @@ | ||
| /** | ||
| * Returns a {@link PushIterator push iterator} without elements. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * | ||
| * @returns Empty push iterator instance. | ||
| */ | ||
| function overNone() { | ||
| return PushIterator$empty; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over one value. | ||
| * | ||
| * @typeParam T - Iterated element value type. | ||
| * @param value - A value to iterate over. | ||
| * | ||
| * @returns New push iterable over the given value. | ||
| */ | ||
| function overOne(value) { | ||
| return makePushIterable(iterateOverOneValue(value)); | ||
| } | ||
| function iterateOverOneValue(value) { | ||
| return accept => { | ||
| if (accept) { | ||
| accept(value); | ||
| return PushIterator$empty; | ||
| } | ||
| let over = false; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| if (over) { | ||
| return PushIterator$empty; | ||
| } | ||
| if (accept) { | ||
| over = true; | ||
| accept(value); | ||
| return PushIterator$empty; | ||
| } | ||
| return this; | ||
| }, | ||
| next() { | ||
| if (over) { | ||
| return { done: over }; | ||
| } | ||
| over = true; | ||
| return { value }; | ||
| }, | ||
| isOver: () => over, | ||
| }; | ||
| }; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over many values. | ||
@@ -491,7 +99,3 @@ * | ||
| function overMany(...values) { | ||
| return values.length > 1 | ||
| ? overArray(values) | ||
| : (values.length | ||
| ? overOne(values[0]) | ||
| : overNone()); | ||
| return values.length > 1 ? overArray(values) : values.length ? overOne(values[0]) : overNone(); | ||
| } | ||
@@ -511,3 +115,3 @@ | ||
| function reverseArray$iterate(array) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
@@ -539,3 +143,2 @@ return reverseArray$process(array, accept, mode); | ||
| iterate = PushIterator$dontIterate; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
@@ -565,3 +168,3 @@ } | ||
| function reverseArray$process(array, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* All */) { | ||
| if (mode === 2 /* PushIterationMode.All */) { | ||
| for (let i = array.length - 1; i >= 0; --i) { | ||
@@ -590,3 +193,5 @@ accept(array[i]); | ||
| function itsEach(iterable, action) { | ||
| iterateIt(iterable, element => { action(element); }, 2 /* All */); | ||
| iterateIt(iterable, element => { | ||
| action(element); | ||
| }, 2 /* PushIterationMode.All */); | ||
| } | ||
@@ -608,3 +213,5 @@ | ||
| const result = []; | ||
| it[PushIterator__symbol](element => { result.push(convert(element)); }, 2 /* All */); | ||
| it[PushIterator__symbol](element => { | ||
| result.push(convert(element)); | ||
| }, 2 /* PushIterationMode.All */); | ||
| return result; | ||
@@ -625,9 +232,7 @@ } | ||
| const it = iterable[Symbol.iterator](); | ||
| return isPushIterable(it) | ||
| ? itsEmpty$(it) | ||
| : !!it.next().done; | ||
| return isPushIterable(it) ? itsEmpty$(it) : !!it.next().done; | ||
| } | ||
| function itsEmpty$(it) { | ||
| let isEmpty = true; | ||
| it[PushIterator__symbol](_element => isEmpty = false, 1 /* Only */); | ||
| it[PushIterator__symbol](_element => (isEmpty = false), 1 /* PushIterationMode.Only */); | ||
| return isEmpty; | ||
@@ -652,3 +257,3 @@ } | ||
| return allMatch ? void 0 : false; | ||
| }, 1 /* Only */); | ||
| }, 1 /* PushIterationMode.Only */); | ||
| return allMatch; | ||
@@ -677,3 +282,3 @@ } | ||
| } | ||
| }, 1 /* Only */); | ||
| }, 1 /* PushIterationMode.Only */); | ||
| return find; | ||
@@ -702,3 +307,3 @@ } | ||
| return false; | ||
| }, 1 /* Only */); | ||
| }, 1 /* PushIterationMode.Only */); | ||
| return first; | ||
@@ -721,5 +326,3 @@ } | ||
| const it = iterable[Symbol.iterator](); | ||
| return isPushIterable(it) | ||
| ? it | ||
| : iterator$convert(it, iterator$pusher(it)); | ||
| return isPushIterable(it) ? it : iterator$convert(it, iterator$pusher(it)); | ||
| } | ||
@@ -744,3 +347,3 @@ | ||
| } | ||
| }, 1 /* Only */); | ||
| }, 1 /* PushIterationMode.Only */); | ||
| return match; | ||
@@ -764,3 +367,5 @@ } | ||
| let reduced = initialValue; | ||
| iterateIt(iterable, element => { reduced = reducer(reduced, element); }, 2 /* All */); | ||
| iterateIt(iterable, element => { | ||
| reduced = reducer(reduced, element); | ||
| }, 2 /* PushIterationMode.All */); | ||
| return reduced; | ||
@@ -785,3 +390,3 @@ } | ||
| return someMatches ? false : void 0; | ||
| }, 1 /* Only */); | ||
| }, 1 /* PushIterationMode.Only */); | ||
| return someMatches; | ||
@@ -805,5 +410,5 @@ } | ||
| function filterIndexed$(indexed, elementOf, test) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
| return indexed$process(indexed, elementOf, element => test(element) ? accept(element) : void 0, mode); | ||
| return indexed$process(indexed, elementOf, element => (test(element) ? accept(element) : void 0), mode); | ||
| } | ||
@@ -833,3 +438,2 @@ let i = 0; | ||
| iterate = PushIterator$dontIterate; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
@@ -873,3 +477,3 @@ } | ||
| function filterIt(source, test) { | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| return makePushIterable((accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
@@ -881,12 +485,12 @@ const acceptElement = (element) => test(element) ? accept(element) : void 0; | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? filterIt$(source, test) | ||
| : filterIt$raw(source, test); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : makePushIterator(forNext); | ||
| const forNext = isPushIterable(source) ? filterIt$(source, test) : filterIt$raw(source, test); | ||
| return accept && !forNext(accept) ? PushIterator$empty : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function filterIt$(source, test) { | ||
| return accept => !(source = source[PushIterator__symbol](element => test(element) ? accept(element) : void 0)).isOver(); | ||
| return accept => { | ||
| const src = source[PushIterator__symbol](element => (test(element) ? accept(element) : void 0)); | ||
| source = src; | ||
| return !src.isOver(); | ||
| }; | ||
| } | ||
@@ -915,8 +519,2 @@ function filterIt$raw(source, test) { | ||
| function flatMapArray(array, convert) { | ||
| return flatMapArray$(array, convert | ||
| ? (array, index) => convert(array[index]) | ||
| : flatMapArray$defaultElementOf); | ||
| } | ||
| function flatMapIndexed(indexed, convert) { | ||
@@ -931,115 +529,2 @@ return makePushIterable(flatMapIndexed$(indexed, convert | ||
| function flatMapIt(source, convert = flatMapIt$defaultConverter) { | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| return isPushIterable(source) | ||
| ? flatMapIt$process(source, convert, accept, mode) | ||
| : flatMapIt$raw$process(source, convert, accept, mode); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? flatMapIt$(source, convert) | ||
| : flatMapIt$raw(source, convert); | ||
| return accept && !forNext(accept) | ||
| ? overNone() | ||
| : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function flatMapIt$(source, convert) { | ||
| let subs; | ||
| let lastSrc = false; | ||
| return accept => { | ||
| for (;;) { | ||
| while (!subs) { | ||
| const sourceTail = source[PushIterator__symbol](src => { | ||
| subs = convert(src); | ||
| return true; | ||
| }); | ||
| source = sourceTail; | ||
| if (sourceTail.isOver()) { | ||
| if (!subs) { | ||
| return false; | ||
| } | ||
| lastSrc = true; | ||
| } | ||
| } | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => status = accept(element)); | ||
| if (subsTail.isOver()) { | ||
| subs = undefined; | ||
| if (lastSrc) { | ||
| return false; | ||
| } | ||
| } | ||
| else { | ||
| subs = subsTail; | ||
| } | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| function flatMapIt$raw(source, convert) { | ||
| const it = source[Symbol.iterator](); | ||
| if (isPushIterable(it)) { | ||
| return flatMapIt$(it, convert); | ||
| } | ||
| let subs; | ||
| return accept => { | ||
| for (;;) { | ||
| if (!subs) { | ||
| const next = it.next(); | ||
| if (next.done) { | ||
| return false; | ||
| } | ||
| subs = convert(next.value); | ||
| } | ||
| // eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
| let status; | ||
| const subsTail = iterateIt(subs, element => status = accept(element)); | ||
| subs = subsTail.isOver() ? undefined : subsTail; | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| function flatMapIt$process(source, convert, accept, mode) { | ||
| if (mode === 2 /* All */) { | ||
| source[PushIterator__symbol](src => iterateIt(convert(src), accept, mode)); | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => status = accept(element); | ||
| source[PushIterator__symbol]((src) => { | ||
| iterateIt(convert(src), subProcess, mode); | ||
| if (status === false) { | ||
| return false; | ||
| } | ||
| }); | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapIt$raw$process(source, convert, accept, mode) { | ||
| if (mode === 2 /* All */) { | ||
| for (const src of source) { | ||
| iterateIt(convert(src), accept, mode); | ||
| } | ||
| } | ||
| else { | ||
| let status; | ||
| const subProcess = (element) => status = accept(element); | ||
| for (const src of source) { | ||
| iterateIt(convert(src), subProcess, mode); | ||
| if (status === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
| function flatMapIt$defaultConverter(element) { | ||
| return element; | ||
| } | ||
| /** | ||
@@ -1088,3 +573,3 @@ * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every element | ||
| function mapIt(source, convert) { | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| return makePushIterable((accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
@@ -1096,8 +581,4 @@ const acceptElement = (element) => accept(convert(element)); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? mapIt$(source, convert) | ||
| : mapIt$raw(source, convert); | ||
| return accept && !forNext(accept) | ||
| ? overNone() | ||
| : makePushIterator(forNext); | ||
| const forNext = isPushIterable(source) ? mapIt$(source, convert) : mapIt$raw(source, convert); | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| }); | ||
@@ -1128,5 +609,5 @@ } | ||
| function valueIndexed$(indexed, elementOf, valueOf) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| return (accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
| return indexed$process(indexed, (source, index) => valueOf(elementOf(source, index)), value => value != null && value !== false ? accept(value) : void 0, mode); | ||
| return indexed$process(indexed, (source, index) => valueOf(elementOf(source, index)), value => (value != null && value !== false ? accept(value) : void 0), mode); | ||
| } | ||
@@ -1156,3 +637,2 @@ let i = 0; | ||
| iterate = PushIterator$dontIterate; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
@@ -1243,9 +723,7 @@ } | ||
| function valueIt(source, valueOf) { | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| return makePushIterable((accept, mode = 0 /* PushIterationMode.Some */) => { | ||
| if (accept && mode > 0) { | ||
| const acceptElement = (element) => { | ||
| const value = valueOf(element); | ||
| return value != null && value !== false | ||
| ? accept(value) | ||
| : void 0; | ||
| return value != null && value !== false ? accept(value) : void 0; | ||
| }; | ||
@@ -1259,5 +737,3 @@ return isPushIterable(source) | ||
| : valueIt$raw(source, valueOf); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : makePushIterator(forNext); | ||
| return accept && !forNext(accept) ? PushIterator$empty : makePushIterator(forNext); | ||
| }); | ||
@@ -1268,5 +744,3 @@ } | ||
| const value = valueOf(element); | ||
| return value != null && value !== false | ||
| ? accept(value) | ||
| : void 0; | ||
| return value != null && value !== false ? accept(value) : void 0; | ||
| })).isOver(); | ||
@@ -1311,3 +785,3 @@ } | ||
| export { PushIterator__symbol, filterArray, filterIndexed, filterIt, flatMapArray, flatMapIndexed, flatMapIt, isPushIterable, iteratorOf, itsEach, itsElements, itsEmpty, itsEvery, itsFind, itsFirst, itsIterator, itsMatch, itsReduction, itsSome, makePushIterable, makePushIterator, mapArray, mapIndexed, mapIt, overArray, overElementsOf, overEntries, overIndexed, overIterable, overIterator, overKeys, overMany, overNone, overOne, reverseArray, valueArray, valueIndexed, valueIt }; | ||
| export { PushIterator__symbol, filterArray, filterIndexed, filterIt, flatMapIndexed, isPushIterable, iteratorOf, itsEach, itsElements, itsEmpty, itsEvery, itsFind, itsFirst, itsIterator, itsMatch, itsReduction, itsSome, makePushIterable, makePushIterator, mapArray, mapIndexed, mapIt, overArray, overElementsOf, overEntries, overIndexed, overIterable, overIterator, overKeys, overMany, overNone, overOne, reverseArray, valueArray, valueIndexed, valueIt }; | ||
| //# sourceMappingURL=push-iterator.js.map |
+1
-1
| MIT License | ||
| Copyright (c) 2020,2021 Ruslan Lopatin <ruslan.lopatin@gmail.com> | ||
| Copyright (c) 2020-2023 Ruslan Lopatin <ruslan.lopatin@gmail.com> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+55
-43
| { | ||
| "name": "@proc7ts/push-iterator", | ||
| "version": "3.1.0", | ||
| "version": "3.1.1", | ||
| "description": "Push iteration protocol", | ||
@@ -22,7 +22,19 @@ "keywords": [ | ||
| "type": "module", | ||
| "main": "./dist/push-iterator.js", | ||
| "types": "./index.d.ts", | ||
| "types": "./dist/push-iterator.d.ts", | ||
| "typesVersions": { | ||
| "*": { | ||
| "call-thru": [ | ||
| "./dist/push-iterator.call-thru.d.ts" | ||
| ] | ||
| } | ||
| }, | ||
| "exports": { | ||
| ".": "./dist/push-iterator.js", | ||
| "./call-thru": "./dist/push-iterator.call-thru.js" | ||
| ".": { | ||
| "types": "./dist/push-iterator.d.ts", | ||
| "default": "./dist/push-iterator.js" | ||
| }, | ||
| "./call-thru": { | ||
| "type": "./dist/push-iterator.call-thru.d.ts", | ||
| "default": "./dist/push-iterator.call-thru.js" | ||
| } | ||
| }, | ||
@@ -38,31 +50,31 @@ "peerDependencies": { | ||
| "devDependencies": { | ||
| "@jest/globals": "^27.0.6", | ||
| "@jest/globals": "^29.4.0", | ||
| "@proc7ts/call-thru": "^4.4.0", | ||
| "@rollup/plugin-commonjs": "^19.0.1", | ||
| "@rollup/plugin-node-resolve": "^13.0.2", | ||
| "@run-z/eslint-config": "^1.3.0", | ||
| "@run-z/rollup-helpers": "^1.1.1", | ||
| "@types/benchmark": "^2.1.1", | ||
| "@types/node": "^12.20.16", | ||
| "@typescript-eslint/eslint-plugin": "^4.28.3", | ||
| "@typescript-eslint/parser": "^4.28.3", | ||
| "@rollup/plugin-node-resolve": "^15.0.1", | ||
| "@rollup/plugin-typescript": "^11.0.0", | ||
| "@run-z/eslint-config": "^3.3.1", | ||
| "@run-z/prettier-config": "^2.0.0", | ||
| "@run-z/project-config": "^0.15.0", | ||
| "@swc/core": "^1.3.28", | ||
| "@swc/jest": "^0.2.24", | ||
| "@types/benchmark": "^2.1.2", | ||
| "@typescript-eslint/eslint-plugin": "^5.49.0", | ||
| "@typescript-eslint/parser": "^5.49.0", | ||
| "benchmark": "^2.1.4", | ||
| "chalk": "^4.1.1", | ||
| "eslint": "^7.30.0", | ||
| "eslint-plugin-jest": "^24.3.6", | ||
| "gh-pages": "^3.2.3", | ||
| "jest": "^27.0.6", | ||
| "jest-junit": "^12.2.0", | ||
| "remark-cli": "^9.0.0", | ||
| "remark-preset-lint-recommended": "^5.0.0", | ||
| "rollup": "^2.53.2", | ||
| "rollup-plugin-flat-dts": "^1.2.2", | ||
| "chalk": "^5.2.0", | ||
| "eslint": "^8.32.0", | ||
| "eslint-plugin-jest": "^27.2.1", | ||
| "gh-pages": "^5.0.0", | ||
| "jest": "^29.4.0", | ||
| "jest-junit": "^15.0.0", | ||
| "prettier": "^2.8.3", | ||
| "prettier-eslint-cli": "^7.1.0", | ||
| "rollup": "^3.10.1", | ||
| "rollup-plugin-sourcemaps": "^0.6.3", | ||
| "rollup-plugin-typescript2": "^0.30.0", | ||
| "run-z": "=1.9.2-bootstrap", | ||
| "shx": "^0.3.3", | ||
| "ts-jest": "^27.0.3", | ||
| "tslib": "^2.3.0", | ||
| "typedoc": "^0.21.4", | ||
| "typescript": "^4.3.5" | ||
| "rollup-plugin-unbundle": "^0.2.3", | ||
| "run-z": "1.11.0-bootstrap", | ||
| "ts-jest": "^29.0.5", | ||
| "tslib": "^2.4.1", | ||
| "typedoc": "^0.23.24", | ||
| "typescript": "~4.9.4" | ||
| }, | ||
@@ -72,18 +84,18 @@ "scripts": { | ||
| "benchmark": "run-z benchmark:build --then node --no-warnings --enable-source-maps ./target/benchmark.js", | ||
| "benchmark:build": "run-z --then rollup --config rollup.benchmark.config.mjs", | ||
| "benchmark:record": "run-z benchmark:build benchmark:record:node16 benchmark:record:node14 benchmark:record:node12", | ||
| "benchmark:record:node12": "LANG=C FORCE_COLOR=0 npx -q node@12 ./target/benchmark.js > ./benchmarks/node12.txt", | ||
| "benchmark:record:node14": "LANG=C FORCE_COLOR=0 npx -q node@14 ./target/benchmark.js > ./benchmarks/node14.txt", | ||
| "benchmark:record:node16": "LANG=C FORCE_COLOR=0 npx -q node@16 ./target/benchmark.js > ./benchmarks/node16.txt", | ||
| "bootstrap": "rollup -c", | ||
| "benchmark:build": "run-z --then rollup --config rollup.benchmark.config.js", | ||
| "benchmark:record": "run-z benchmark:build benchmark:record:node18 benchmark:record:node16 benchmark:record:node14", | ||
| "benchmark:record:node14": "LANG=C FORCE_COLOR=0 pnpm --package node@14 dlx node ./target/benchmark.js > ./benchmarks/node14.txt", | ||
| "benchmark:record:node16": "LANG=C FORCE_COLOR=0 pnpm --package node@16 dlx node ./target/benchmark.js > ./benchmarks/node16.txt", | ||
| "benchmark:record:node18": "LANG=C FORCE_COLOR=0 pnpm --package node@18 dlx node ./target/benchmark.js > ./benchmarks/node18.txt", | ||
| "bootstrap": "build-z", | ||
| "build": "run-z +z bootstrap", | ||
| "ci:all": "run-z all +test/--ci/--runInBand", | ||
| "clean": "run-z +z --then shx rm -rf 'index.d.ts?(.map)' '*/index.d.ts?(.map)' dist target", | ||
| "clean": "run-z +z --then clean-z", | ||
| "doc": "run-z +z --then typedoc", | ||
| "doc:publish": "run-z doc --then gh-pages --dist target/typedoc --dotfiles", | ||
| "lint": "run-z + lint:md --and eslint .", | ||
| "lint:md": "run-z +z --then remark .", | ||
| "test": "run-z +z env:NODE_OPTIONS='--experimental-vm-modules --no-warnings' --then jest", | ||
| "z": "run-z +cmd:rollup,+cmd:typedoc,+cmd:eslint,+cmd:remark,+cmd:jest" | ||
| "format": "run-z +z --then prettier-eslint --write --include-dot-files \"src/**/*.*\" \"*.{js,cjs,json,md}\"", | ||
| "lint": "run-z +z --then eslint .", | ||
| "test": "run-z +z env:NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" --then test-z", | ||
| "z": "run-z +cmd:rollup,+cmd,+cmd:typedoc,+cmd:eslint,+cmd:jest" | ||
| } | ||
| } | ||
| } |
+95
-114
@@ -1,3 +0,2 @@ | ||
| Push Iteration Protocol | ||
| ======================= | ||
| # Push Iteration Protocol | ||
@@ -9,3 +8,3 @@ [![NPM][npm-image]][npm-url] | ||
| [![GitHub Project][github-image]][github-url] | ||
| [![API Documentation][api-docs-image]][API documentation] | ||
| [![API Documentation][api-docs-image]][api documentation] | ||
@@ -26,4 +25,3 @@ Push iteration protocol is a faster alternative to traditional JavaScript [iteration protocol]. | ||
| [iteration protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | ||
| [Iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol | ||
| [iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol | ||
| [npm-image]: https://img.shields.io/npm/v/@proc7ts/push-iterator.svg?logo=npm | ||
@@ -40,8 +38,6 @@ [npm-url]: https://www.npmjs.com/package/@proc7ts/push-iterator | ||
| [api-docs-image]: https://img.shields.io/static/v1?logo=typescript&label=API&message=docs&color=informational | ||
| [API documentation]: https://proc7ts.github.io/push-iterator/ | ||
| [api documentation]: https://proc7ts.github.io/push-iterator/ | ||
| ## Instant Iteration | ||
| Instant Iteration | ||
| ----------------- | ||
| It is quite common to just iterate over [Iterable] instantly rather constructing its [Iterator]. The library supports | ||
@@ -52,6 +48,4 @@ this. For that, a `[PushIterator__symbol]` method may be defined for [Iterable] in addition to `[Symbol.iterator]` one. | ||
| ## Iteration Mode Hints | ||
| Iteration Mode Hints | ||
| -------------------- | ||
| The `[PushIterator__symbol](accept?, mode?)` method of `PushIterable` interface accepts optional _iteration mode_ hint | ||
@@ -74,6 +68,4 @@ as second parameter. The latter used to optimize iteration algorithm. Such hints provided by iterable consumption | ||
| ## Rationale | ||
| Rationale | ||
| --------- | ||
| **Performance!** | ||
@@ -92,8 +84,6 @@ | ||
| ## Design Goals | ||
| Design Goals | ||
| ------------ | ||
| 1. **Performance**. | ||
| 1. **Performance**. | ||
| Push iterators are faster. Still, a lot of the code base relies on raw iterators and arrays. The library contains | ||
@@ -112,11 +102,8 @@ performance optimizations to deal with it. | ||
| [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol | ||
| [iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol | ||
| ## API | ||
| API | ||
| --- | ||
| See the full [API documentation]. | ||
| ### Push Iterable Construction | ||
@@ -126,38 +113,36 @@ | ||
| - [`overArray(array)`][overArray] - Creates a push iterable over elements of array-like structure. | ||
| - [`overElementsOf(...iterables)`][overElementsOf] - Creates a push iterable over elements of other iterables. | ||
| - [`overEntries(object)`][overEntries] - Creates a push iterable over the property key/value entries of the given | ||
| - [`overArray(array)`][overarray] - Creates a push iterable over elements of array-like structure. | ||
| - [`overElementsOf(...iterables)`][overelementsof] - Creates a push iterable over elements of other iterables. | ||
| - [`overEntries(object)`][overentries] - Creates a push iterable over the property key/value entries of the given | ||
| object. | ||
| - [`overIndexed(indexed)`][overIndexed] - Creates a push iterable over items of [indexed list]. | ||
| - [`overIterable(iterable)`][overIterable] - Creates a push iterable over elements of the given raw iterable. | ||
| - [`overIterator(() => Iterator)`][overIterator] - Creates a push iterable over elements of iterator created by the | ||
| given function. | ||
| - [`overKeys(object)`][overKeys] - Creates a push iterable over keys of the given object. | ||
| - [`overMany(...values)`][overMany] - Creates a push iterable over many values. | ||
| - [`overNone()`][overNone] - Returns a push iterable iterator without elements. | ||
| - [`overOne(value)`][overOne] - Creates a push iterable over one value. | ||
| - [`reverseArray(array)`][reverseArray] - Creates a push iterable over elements of array-like structure in reverse | ||
| - [`overIndexed(indexed)`][overindexed] - Creates a push iterable over items of [indexed list]. | ||
| - [`overIterable(iterable)`][overiterable] - Creates a push iterable over elements of the given raw iterable. | ||
| - [`overIterator(() => Iterator)`][overiterator] - Creates a push iterable over elements of iterator created by the | ||
| given function. | ||
| - [`overKeys(object)`][overkeys] - Creates a push iterable over keys of the given object. | ||
| - [`overMany(...values)`][overmany] - Creates a push iterable over many values. | ||
| - [`overNone()`][overnone] - Returns a push iterable iterator without elements. | ||
| - [`overOne(value)`][overone] - Creates a push iterable over one value. | ||
| - [`reverseArray(array)`][reversearray] - Creates a push iterable over elements of array-like structure in reverse | ||
| order. | ||
| [overArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overArray | ||
| [overElementsOf]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overElementsOf | ||
| [overEntries]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overEntries | ||
| [overIndexed]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overIndexed | ||
| [overIterable]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overIterable | ||
| [overIterator]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overIterator | ||
| [overKeys]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overKeys | ||
| [overMany]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overMany | ||
| [overNone]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overNone | ||
| [overOne]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#overOne | ||
| [reverseArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#reverseArray | ||
| [overarray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overArray | ||
| [overelementsof]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overElementsOf | ||
| [overentries]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overEntries | ||
| [overindexed]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overIndexed | ||
| [overiterable]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overIterable | ||
| [overiterator]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overIterator | ||
| [overkeys]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overKeys | ||
| [overmany]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overMany | ||
| [overnone]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overNone | ||
| [overone]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#overOne | ||
| [reversearray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#reverseArray | ||
| ### Iteration | ||
| [`iterateIt(iterable, accept): PushIterator`][iterateIt] function iterates over the leading elements of the given | ||
| [`iterateIt(iterable, accept): PushIterator`][iterateit] function iterates over the leading elements of the given | ||
| iterable and returns its trailing iterator. | ||
| [iterateIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#iterateIt | ||
| [iterateit]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#iterateIt | ||
| ### Iterable Consumption | ||
@@ -167,31 +152,30 @@ | ||
| - [`itsEach(iterable, action)`][itsEach] - Performs the given `action` for each element of the given `iterable`. | ||
| - [`itsElements(iterable[, convert])`][itsElements] - Creates a new, shallow-copied array instance containing elements | ||
| of the source iterable optionally converted by the given converter function. This is an `Array.from()` function | ||
| analog optimized for push iterables. | ||
| - [`itsEmpty(iterable): boolean`][itsEmpty] - Checks whether the given `iterable` is empty. | ||
| - [`itsEvery(iterable, test): boolean`][itsEvery] - Tests whether all elements of the given `iterable` pass the test | ||
| - [`itsEach(iterable, action)`][itseach] - Performs the given `action` for each element of the given `iterable`. | ||
| - [`itsElements(iterable[, convert])`][itselements] - Creates a new, shallow-copied array instance containing elements | ||
| of the source iterable optionally converted by the given converter function. This is an `Array.from()` function | ||
| analog optimized for push iterables. | ||
| - [`itsEmpty(iterable): boolean`][itsempty] - Checks whether the given `iterable` is empty. | ||
| - [`itsEvery(iterable, test): boolean`][itsevery] - Tests whether all elements of the given `iterable` pass the test | ||
| implemented by the provided function. | ||
| - [`itsFind(iterable, search): R | undefined`][itsFind] - Searches for the value in `iterable`. | ||
| - [`itsFirst(iterable): T | undefined`][itsFirst] - Extracts the first element of the given `iterable`, if any. | ||
| - [`itsIterator(iterable)`][itsIterator] - Starts iteration over the given `iterable`. Always returns a push iterator. | ||
| - [`itsMatch(iterable, test): T | undefined`][itsMatch] - Extracts the first element matching the given condition from | ||
| - [`itsFind(iterable, search): R | undefined`][itsfind] - Searches for the value in `iterable`. | ||
| - [`itsFirst(iterable): T | undefined`][itsfirst] - Extracts the first element of the given `iterable`, if any. | ||
| - [`itsIterator(iterable)`][itsiterator] - Starts iteration over the given `iterable`. Always returns a push iterator. | ||
| - [`itsMatch(iterable, test): T | undefined`][itsmatch] - Extracts the first element matching the given condition from | ||
| `iterable`. | ||
| - [`itsReduction(iterable, reducer, initialValue): T`][itsReduction] - Applies a function against an accumulator and | ||
| each element of the given `iterable` to reduce elements to a single value. | ||
| - [`itsSome(iterable, test): boolean`][itsSome] - Tests whether at least one element of the given `iterable` passes the | ||
| - [`itsReduction(iterable, reducer, initialValue): T`][itsreduction] - Applies a function against an accumulator and | ||
| each element of the given `iterable` to reduce elements to a single value. | ||
| - [`itsSome(iterable, test): boolean`][itssome] - Tests whether at least one element of the given `iterable` passes the | ||
| test implemented by the provided function. | ||
| [itsEach]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsEach | ||
| [itsElements]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsElements | ||
| [itsEmpty]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsEmpty | ||
| [itsEvery]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsEvery | ||
| [itsFind]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsFind | ||
| [itsFirst]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsFirst | ||
| [itsIterator]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsIterator | ||
| [itsMatch]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsMatch | ||
| [itsReduction]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsReduction | ||
| [itsSome]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#itsSome | ||
| [itseach]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsEach | ||
| [itselements]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsElements | ||
| [itsempty]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsEmpty | ||
| [itsevery]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsEvery | ||
| [itsfind]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsFind | ||
| [itsfirst]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsFirst | ||
| [itsiterator]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsIterator | ||
| [itsmatch]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsMatch | ||
| [itsreduction]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsReduction | ||
| [itssome]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#itsSome | ||
| ### Iterable Transformation | ||
@@ -201,36 +185,34 @@ | ||
| - [`filterIt(source, test)`][filterIt] - Creates a push iterable with all `source` iterable elements that pass the test | ||
| - [`filterIt(source, test)`][filterit] - Creates a push iterable with all `source` iterable elements that pass the test | ||
| implemented by provided function. | ||
| - [`flatMapIt(source, convert?)`][flatMapIt] - First maps each element of the `source` iterable using a mapping | ||
| - [`flatMapIt(source, convert?)`][flatmapit] - First maps each element of the `source` iterable using a mapping | ||
| function, then flattens the result into new push iterable. | ||
| - [`mapIt(source, convert)`][mapIt] - Creates a push iterable with the results of calling a provided function on every | ||
| - [`mapIt(source, convert)`][mapit] - Creates a push iterable with the results of calling a provided function on every | ||
| element of the `source` iterable. | ||
| - [`valueIt(source, valueOf)`][valueIt] - Creates a push iterable with the values of elements of the `source` iterable. | ||
| A more effective combination of [mapIt]/[filterIt]. | ||
| - [`valueIt(source, valueOf)`][valueit] - Creates a push iterable with the values of elements of the `source` iterable. | ||
| A more effective combination of [mapIt]/[filterIt]. | ||
| [filterIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#filterIt | ||
| [flatMapIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#flatMapIt | ||
| [mapIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#mapIt | ||
| [valueIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#valueIt | ||
| [filterit]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#filterIt | ||
| [flatmapit]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#flatMapIt | ||
| [mapit]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#mapIt | ||
| [valueit]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#valueIt | ||
| ### Array Transformation | ||
| Each of the following functions accepts an array-like instance, and returns a push iterable: | ||
| Each of the following functions accepts an array-like instance, and returns a push iterable: | ||
| - [`filterArray(array, test)`][filterArray] - Creates a push iterable with all `array` elements that pass the test | ||
| - [`filterArray(array, test)`][filterarray] - Creates a push iterable with all `array` elements that pass the test | ||
| implemented by provided function. | ||
| - [`flatMapArray(array, convert?)`][flatMapArray] - First maps each element of the source `array` using a mapping | ||
| - [`flatMapArray(array, convert?)`][flatmaparray] - First maps each element of the source `array` using a mapping | ||
| function, then flattens the result into new push iterable. | ||
| - [`mapArray(array, convert)`][mapArray] - Creates a push iterable with the results of calling a provided function on | ||
| - [`mapArray(array, convert)`][maparray] - Creates a push iterable with the results of calling a provided function on | ||
| every element of the given `array`. | ||
| - [`valueArray(array, valueOf)`][valueArray] - Creates a push iterable with the values of elements of the given `array`. | ||
| - [`valueArray(array, valueOf)`][valuearray] - Creates a push iterable with the values of elements of the given `array`. | ||
| A more effective combination of [mapArray]/[filterIt]. | ||
| [filterArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#filterArray | ||
| [flatMapArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#flatMapArray | ||
| [mapArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#mapArray | ||
| [valueArray]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#valueArray | ||
| [filterarray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#filterArray | ||
| [flatmaparray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#flatMapArray | ||
| [maparray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#mapArray | ||
| [valuearray]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#valueArray | ||
| ### Indexed List Transformation | ||
@@ -241,33 +223,32 @@ | ||
| - `length` contains the length of the list, | ||
| - `item(index: number): T | null | undefined` returns the item value under the given index. | ||
| - `item(index: number): T | null | undefined` returns the item value under the given index. | ||
| Each of the following functions accepts an indexed list of items, and returns a push iterable: | ||
| - [`filterIndexed(indexed, test)`][filterIndexed] - Creates a push iterable with all items of the given indexed list | ||
| - [`filterIndexed(indexed, test)`][filterindexed] - Creates a push iterable with all items of the given indexed list | ||
| that pass the test implemented by the provided function. | ||
| - [`flatMapIndexed(indexed, convert?)`][flatMapIndexed] - First maps each item of the source indexed list using | ||
| - [`flatMapIndexed(indexed, convert?)`][flatmapindexed] - First maps each item of the source indexed list using | ||
| a mapping function, then flattens the result into new push iterable. | ||
| - [`mapIndexed(array, convert)`][mapIndexed] - Creates a push iterable with the results of calling a provided function | ||
| - [`mapIndexed(array, convert)`][mapindexed] - Creates a push iterable with the results of calling a provided function | ||
| on every item of the given indexed list. | ||
| - [`valueIndexed(array, convert)`][valueIndexed] - Creates a push iterable with the values of items of the given indexed | ||
| - [`valueIndexed(array, convert)`][valueindexed] - Creates a push iterable with the values of items of the given indexed | ||
| list. A more effective combination of [mapIndexed]/[filterIt]. | ||
| [indexed list]: https://proc7ts.github.io/push-iterator/interfaces/@proc7ts_push-iterator.IndexedItemList.html | ||
| [filterIndexed]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#filterIndexed | ||
| [flatMapIndexed]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#flatMapIndexed | ||
| [mapIndexed]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#mapIndexed | ||
| [valueIndexed]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#valueIndexed | ||
| [indexed list]: https://proc7ts.github.io/push-iterator/interfaces/_proc7ts_push-iterator.IndexedItemList.html | ||
| [filterindexed]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#filterIndexed | ||
| [flatmapindexed]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#flatMapIndexed | ||
| [mapindexed]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#mapIndexed | ||
| [valueindexed]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#valueIndexed | ||
| ### Utilities | ||
| - [`isPushIterable(iterable)`][isPushIterable] - Checks whether the given iterable or iterator conforms to push | ||
| - [`isPushIterable(iterable)`][ispushiterable] - Checks whether the given iterable or iterator conforms to push | ||
| iteration protocol. | ||
| - [`iteratorOf(iterable)`][iteratorOf] - Creates iterator over elements of the given `iterable`. | ||
| - [`makePushIterable(iterate)`][makePushIterable] - Creates a push iterable implementation. | ||
| - [`makePushIterator(forNext)`][makePushIterator] - Creates a push iterator implementation. | ||
| - [`iteratorOf(iterable)`][iteratorof] - Creates iterator over elements of the given `iterable`. | ||
| - [`makePushIterable(iterate)`][makepushiterable] - Creates a push iterable implementation. | ||
| - [`makePushIterator(forNext)`][makepushiterator] - Creates a push iterator implementation. | ||
| [isPushIterable]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#isPushIterable | ||
| [iteratorOf]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#iteratorOf | ||
| [makePushIterable]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#makePushIterable | ||
| [makePushIterator]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#makePushIterator | ||
| [ispushiterable]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#isPushIterable | ||
| [iteratorof]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#iteratorOf | ||
| [makepushiterable]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#makePushIterable | ||
| [makepushiterator]: https://proc7ts.github.io/push-iterator/modules/_proc7ts_push_iterator.html#makePushIterator |
| /// <reference lib="es2019" /> | ||
| /// <reference path="../index.d.ts" /> | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import type { CallChain, NextCall, NextSkip } from "@proc7ts/call-thru"; | ||
| /** | ||
| * A call chain transforming elements of iterable. | ||
| * | ||
| * Transformations performed when transformed element requested from final iterable. | ||
| */ | ||
| export interface IterableCallChain extends CallChain { | ||
| /** | ||
| * Calls a pass in this chain with each element of the given iterable. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param pass - A pass to call. | ||
| * @param iterable - Source iterable. | ||
| */ | ||
| iterate<T>(pass: (this: void, arg: T) => any, iterable: Iterable<T>): void; | ||
| } | ||
| export namespace IterableCallChain { | ||
| type Args<TReturn> = TReturn extends NextSkip<any> ? never : (TReturn extends (NextCall<IterableCallChain, infer A, any>) ? A : [ | ||
| TReturn | ||
| ]); | ||
| type Out<TReturn> = TReturn extends NextSkip<any> ? never : (TReturn extends NextCall<IterableCallChain, any, infer A> ? A : TReturn); | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import { NextCall } from "@proc7ts/call-thru"; | ||
| /** | ||
| * Creates a next call in {@link IterableCallChain | iterable call chain} that performs the next passes for each | ||
| * element of the given iterable. | ||
| * | ||
| * This call passes elements to the next call on demand, while the `nextEach()` one transforms them all at once, | ||
| * and iterates over results after that. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable containing elements to pass down the chain. | ||
| * | ||
| * @returns Next call for iterable call chain. | ||
| */ | ||
| export function nextIterate<T>(iterable: Iterable<T>): NextCall<IterableCallChain, [ | ||
| T | ||
| ], T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator/call-thru" { | ||
| import type { PushIterable } from "@proc7ts/push-iterator"; | ||
| type Args<TReturn> = IterableCallChain.Args<TReturn>; | ||
| type Out<TReturn> = IterableCallChain.Out<TReturn>; | ||
| /** | ||
| * Passes each element of the given iterable trough the {@link IterableCallChain | chain of transformation passes}. | ||
| * | ||
| * The passes are preformed by `@proc7ts/call-thru`. | ||
| * | ||
| * @returns An push iterable of transformed elements. | ||
| */ | ||
| export function thruIt<T, TReturn1>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1): PushIterable<Out<TReturn1>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2): PushIterable<Out<TReturn2>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3): PushIterable<Out<TReturn3>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11, TArgs12 extends Args<TReturn11>, TReturn12>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11, pass12: (this: void, ...args: TArgs12) => TReturn12): PushIterable<Out<TReturn4>>; | ||
| export function thruIt<T, TReturn1, TArgs2 extends Args<TReturn1>, TReturn2, TArgs3 extends Args<TReturn2>, TReturn3, TArgs4 extends Args<TReturn3>, TReturn4, TArgs5 extends Args<TReturn4>, TReturn5, TArgs6 extends Args<TReturn5>, TReturn6, TArgs7 extends Args<TReturn6>, TReturn7, TArgs8 extends Args<TReturn7>, TReturn8, TArgs9 extends Args<TReturn8>, TReturn9, TArgs10 extends Args<TReturn9>, TReturn10, TArgs11 extends Args<TReturn10>, TReturn11, TArgs12 extends Args<TReturn11>, TReturn12, TArgs13 extends Args<TReturn12>, TReturn13>(it: Iterable<T>, pass1: (this: void, arg: T) => TReturn1, pass2: (this: void, ...args: TArgs2) => TReturn2, pass3: (this: void, ...args: TArgs3) => TReturn3, pass4: (this: void, ...args: TArgs4) => TReturn4, pass5: (this: void, ...args: TArgs5) => TReturn5, pass6: (this: void, ...args: TArgs6) => TReturn6, pass7: (this: void, ...args: TArgs7) => TReturn7, pass8: (this: void, ...args: TArgs8) => TReturn8, pass9: (this: void, ...args: TArgs9) => TReturn9, pass10: (this: void, ...args: TArgs10) => TReturn10, pass11: (this: void, ...args: TArgs11) => TReturn11, pass12: (this: void, ...args: TArgs12) => TReturn12, pass13: (this: void, ...args: TArgs13) => TReturn13): PushIterable<Out<TReturn4>>; | ||
| } | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"sources":["src/call-thru/iterable-call-chain.ts","src/call-thru/next-iterate.ts","src/call-thru/thru-it.ts"],"names":[],"mappings":";;;IAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,2BAA2B;;;;;;IAOxE,MAAM,WAAW,iBAAkB,CAAA,QAAQ,SAAS;;;;;;;;QASlD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;KAE5E;IAED,MAAM,WAAW,iBAAiB,CAAC;QAEj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,EAAE,OAAO,KAAK,SAAS,GACpD,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC","file":"index.d.ts","sourceRoot":".."} |
| { | ||
| "main": "../dist/push-iterator.call-thru.js", | ||
| "types": "./index.d.ts" | ||
| } |
-858
| /// <reference lib="es2019" /> | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Push iteration mode. | ||
| * | ||
| * This is a hint passed as second argument of {@link PushIterator__symbol} method. It declares what | ||
| * {@link PushIterator.Acceptor element acceptor} shall do, and can be used to optimize the iteration algorithm. | ||
| */ | ||
| export const enum PushIterationMode { | ||
| /** | ||
| * Push the next element if exists, then suspend or abort. | ||
| * | ||
| * This value is typically set in compatibility mode. I.e. when standard iterator used to iterate over push iterator. | ||
| */ | ||
| Next = 1, | ||
| /** | ||
| * Push some elements. Iteration may be suspended or aborted at any moment. | ||
| * | ||
| * This iteration mode is used by default. | ||
| */ | ||
| Some = 0, | ||
| /** | ||
| * Push only some subset of elements, then abort iteration. | ||
| * | ||
| * The {@link PushIterator.Acceptor element acceptor} shall not suspend iteration by returning `true` value in this | ||
| * mode. | ||
| */ | ||
| Only = 1, | ||
| /** | ||
| * Push all elements. | ||
| * | ||
| * The {@link PushIterator.Acceptor element acceptor} shall not suspend or abort iteration by returning boolean value | ||
| * in this mode. | ||
| */ | ||
| All = 2 | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Iterator implementing push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| export interface PushIterator<T> extends IterableIterator<T>, PushIterable<T> { | ||
| [Symbol.iterator](): PushIterator<T>; | ||
| /** | ||
| * Checks whether iteration is over. | ||
| * | ||
| * @returns `true` is there is nothing to iterate any more, or `false` if iteration is still possible. | ||
| */ | ||
| isOver(): boolean; | ||
| } | ||
| export namespace PushIterator { | ||
| /** | ||
| * A signature of iterated elements pusher function conforming to push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `false` to stop iteration. | ||
| * | ||
| * @returns `true` if further iteration is possible, or `false` if there is no more elements left to iterate. | ||
| * The latter is possible only when iteration aborted, i.e. `accept` returned `false`. | ||
| */ | ||
| type Pusher<T> = (this: void, accept: Acceptor<T>) => boolean; | ||
| /** | ||
| * A signature of a function accepting iterated elements. | ||
| * | ||
| * It is able to suspend iteration by returning `true`, or to stop it by returning `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| type Acceptor<T> = EachAcceptor<T> | StoppingAcceptor<T>; | ||
| /** | ||
| * A signature of a function accepting each iterated element unconditionally. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param element - Iterated element. | ||
| */ | ||
| type EachAcceptor<T> = (this: void, element: T) => void; | ||
| /** | ||
| * A signature of a function accepting iterated elements and able to suspend or stop further iteration. | ||
| * | ||
| * When this function returns `true`, the iteration is suspended. I.e. the no more elements would be pushed to this | ||
| * function, but the iteration method (`[PushIterator__symbol]`) would return an iterator that can be used to resume | ||
| * iteration. | ||
| * | ||
| * When this function returns `false`, the iteration is stopped. I.e. the no more elements would be pushed to this | ||
| * function, and the iteration method (`[PushIterator__symbol]`) would return an empty iterator. I.e. the one with | ||
| * its {@link PushIterator.isOver} method always returning `true`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param element - Iterated element. | ||
| * | ||
| * @returns `true` to suspend iteration, or `false` to stop it. | ||
| */ | ||
| type StoppingAcceptor<T> = (this: void, element: T) => boolean; | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * A key of {@link PushIterable} iteration method. | ||
| */ | ||
| export const PushIterator__symbol: unique symbol; | ||
| /** | ||
| * An iterable implementing push iteration protocol. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| export interface PushIterable<T> extends Iterable<T> { | ||
| /** | ||
| * Creates a {@link PushIterator | push iterator} over elements of this iterable. | ||
| * | ||
| * @returns New push iterator instance. | ||
| */ | ||
| [Symbol.iterator](): PushIterator<T>; | ||
| /** | ||
| * Iterates over elements of this push iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * Calling this method with `accept` parameter is a faster alternative to creating a push iterator and iterating with | ||
| * it. | ||
| * | ||
| * Calling this method without arguments is the same as calling `[Symbol.iterator]()` one. | ||
| * | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. Ignored without `accept` | ||
| * parameter. | ||
| * | ||
| * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| * won't be possible with returned iterator. | ||
| */ | ||
| [PushIterator__symbol](accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
| export namespace PushIterable { | ||
| /** | ||
| * A signature of function conforming to push iteration protocol. | ||
| * | ||
| * Used as `PushIterable[PushIterator__symbol]` method implementation when passed to {@link makePushIterable} | ||
| * function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. Ignored without `accept` | ||
| * parameter. | ||
| * | ||
| * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| * won't be possible with returned iterator. | ||
| */ | ||
| type Iterate<T> = (this: void, accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode) => PushIterator<T>; | ||
| } | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Checks whether the given iterable conforms to {@link PushIterable | push iteration protocol}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to check. | ||
| * | ||
| * @returns `true` if the given `iterable` has a {@link PushIterator__symbol [PushIterator__symbol]} property, | ||
| * or `false` otherwise. | ||
| */ | ||
| export function isPushIterable<T>(iterable: Iterable<T>): iterable is PushIterable<T>; | ||
| /** | ||
| * Checks whether the given iterator conforms to {@link PushIterable | push iteration protocol}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterator - An iterator to check. | ||
| * | ||
| * @returns `true` if the given `iterator` has a {@link PushIterator__symbol | [PushIterator__symbol]} property, | ||
| * or `false` otherwise. | ||
| */ | ||
| export function isPushIterable<T>(iterator: Iterator<T>): iterator is PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterator over elements of the given push `iterable`. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - A push iterable to construct iterator of. | ||
| * | ||
| * @returns Push iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: PushIterable<T>): PushIterator<T>; | ||
| /** | ||
| * Creates an iterable iterator over elements of the given `iterable` supporting iterable iteration. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - A push iterable to construct iterator of. | ||
| * | ||
| * @returns Iterable iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: { | ||
| [Symbol.iterator](): IterableIterator<T>; | ||
| }): IterableIterator<T>; | ||
| /** | ||
| * Creates iterator over elements of the given `iterable`. | ||
| * | ||
| * Calls `iterable[Symbol.iterator]()` and returns its result. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to construct iterator of. | ||
| * | ||
| * @returns Either push or raw iterator. | ||
| */ | ||
| export function iteratorOf<T>(iterable: Iterable<T>): Iterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterable implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function iterating over iterable elements conforming to {@link PushIterable.Iterate} requirements. | ||
| * | ||
| * @returns New push iterable instance performing iteration by `forNext` function. | ||
| */ | ||
| export function makePushIterable<T>(iterate: PushIterable.Iterate<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a push iterator implementation. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param forNext - A function iterating over elements conforming to push iteration protocol. | ||
| * | ||
| * @returns New push iterator instance performing iteration by `forNext` function. | ||
| */ | ||
| export function makePushIterator<T>(forNext: PushIterator.Pusher<T>): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of array-like structure. | ||
| * | ||
| * @typeParam T - Array elements type. | ||
| * @param array - An array-like structure. E.g. `Array`, DOM `NodeList`, etc. | ||
| * | ||
| * @returns New push iterable over array elements. | ||
| */ | ||
| export function overArray<T>(array: ArrayLike<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Iterates over elements of the given iterable. | ||
| * | ||
| * Calls `accept` method for each iterated element until there are elements to iterate, or `accept` returned either | ||
| * `true` or `false`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate elements of. | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
| * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| * iteration with, unless `accept` returned `false`. In the latter case the further iteration won't be possible. | ||
| */ | ||
| export function iterateIt<T>(iterable: Iterable<T>, accept: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of iterator created by the given function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterate - A function creating new iterator. | ||
| * | ||
| * @returns New push iterable over elements of created iterator. | ||
| */ | ||
| export function overIterator<T>(iterate: (this: void) => Iterator<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of the given raw iterable. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to iterate over elements of. | ||
| * | ||
| * @returns New push iterable over elements of the given `iterable`. | ||
| */ | ||
| export function overIterable<T>(iterable: Iterable<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of other iterables. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param sources - Source iterables to iterate over elements of. | ||
| * | ||
| * @returns New push iterable over elements of the given `sources`. | ||
| */ | ||
| export function overElementsOf<T>(...sources: readonly Iterable<T>[]): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * An indexed list of items. | ||
| * | ||
| * @typeParam T - Indexed item value. | ||
| */ | ||
| export interface IndexedItemList<T> { | ||
| /** | ||
| * The length of the list. I.e. the number of items it contains. | ||
| */ | ||
| readonly length: number; | ||
| /** | ||
| * Retrieves an item under the given index. | ||
| * | ||
| * @param index - Item index. | ||
| * | ||
| * @returns Either item value, or `null`/`undefined` if there is no item with such index, i.e. if the index is not | ||
| * an integer value, is negative, or greater or equal to the {@link length}. | ||
| */ | ||
| item(index: number): T | null | undefined; | ||
| } | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over items of {@link IndexedItemList | indexed list}. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @param indexed - An indexed list of items. E.g. DOM `NodeList`. | ||
| * | ||
| * @returns New push iterable over list items. | ||
| */ | ||
| export function overIndexed<T>(indexed: IndexedItemList<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Returns a {@link PushIterator push iterator} without elements. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * | ||
| * @returns Empty push iterator instance. | ||
| */ | ||
| export function overNone<T>(): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over one value. | ||
| * | ||
| * @typeParam T - Iterated element value type. | ||
| * @param value - A value to iterate over. | ||
| * | ||
| * @returns New push iterable over the given value. | ||
| */ | ||
| export function overOne<T>(value: T): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over many values. | ||
| * | ||
| * @typeParam T - Iterated elements value type. | ||
| * @param values - Values to iterate over. | ||
| * | ||
| * @returns New push iterable over the given values. | ||
| */ | ||
| export function overMany<T>(...values: readonly T[]): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over elements of array-like structure in reverse order. | ||
| * | ||
| * @typeParam T - Array elements type. | ||
| * @param array - An array-like structure. E.g. `Array`, DOM `NodeList`, etc. | ||
| * | ||
| * @returns New push iterable over array elements in reverse order. | ||
| */ | ||
| export function reverseArray<T>(array: ArrayLike<T>): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Performs the given `action` for each element of the given `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable of elements to perform actions on. | ||
| * @param action - An action to perform on each iterable element. This is a function accepting an element as its only | ||
| * parameter. | ||
| */ | ||
| export function itsEach<T>(iterable: Iterable<T>, action: (this: void, element: T) => void): void; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a new, shallow-copied array instance containing elements of the `source` iterable. | ||
| * | ||
| * Calling this function result to the same result as calling `Array.from(source)`, except it is optimized for | ||
| * {@link PushIterable push iterables}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param source - A source iterable to copy elements from. | ||
| * | ||
| * @returns New array of `source` elements. | ||
| */ | ||
| export function itsElements<T>(source: Iterable<T>): T[]; | ||
| /** | ||
| * Creates a new, shallow-copied array instance containing elements of the `source` iterable converted by the given | ||
| * converter function. | ||
| * | ||
| * Calling this function result to the same result as calling `Array.from(source, convert)`, except it is optimized for | ||
| * {@link PushIterable push iterables}. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TConv - Resulting array elements type. | ||
| * @param source - A source iterable to convert elements from. | ||
| * @param convert - A function that produces an element of result array, taking element of `source` iterable as the only | ||
| * parameter. | ||
| * | ||
| * @returns New array of elements converted from `source` ones. | ||
| */ | ||
| export function itsElements<T, TConv>(source: Iterable<T>, convert: (this: void, element: T) => TConv): TConv[]; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Checks whether the given `iterable` is empty. | ||
| * | ||
| * @param iterable - An iterable or push iterable to check for elements. | ||
| * | ||
| * @returns `true` if the given iterable contains at least one element, or `false` otherwise. | ||
| */ | ||
| export function itsEmpty(iterable: Iterable<unknown>): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Tests whether all elements of the given `iterable` pass the test implemented by the provided function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to test elements of. | ||
| * @param test - A predicate function to test each element. Returns `true` to continue tests, or `false` to stop it | ||
| * and return `false` from the method call. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns `true` if the `test` function returned a truthy value for every element, or `false` otherwise. | ||
| * Returns `true` for empty iterable. | ||
| */ | ||
| export function itsEvery<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Searches for the value in `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TFound - Found value type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * @param search - A function extracting the value from elements. It is called for each iterated element until the value | ||
| * found. Accepts element as the only parameter, and returns extracted value. If returns `false` or `undefined` the | ||
| * search continues from the next element. | ||
| * | ||
| * @returns Either found value or `undefined`. | ||
| */ | ||
| export function itsFind<T, TFound>(iterable: Iterable<T>, search: (this: void, element: T) => TFound | false | undefined): TFound | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Extracts the first element of the given `iterable`, if any. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * | ||
| * @returns Either the first element, or `undefined` if the given `iterable` is empty. | ||
| */ | ||
| export function itsFirst<T>(iterable: Iterable<T>): T | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Starts iteration over the given `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable or push iterable to iterate over. | ||
| * | ||
| * @returns A push iterator iterating over the given iterable. | ||
| */ | ||
| export function itsIterator<T>(iterable: Iterable<T>): PushIterator<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Extracts the first element matching the given condition from `iterable`. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to extract element from. | ||
| * @param test - A predicate function to test elements. Returns truthy value for matching one. It accepts the tested | ||
| * element as the only parameter. | ||
| * | ||
| * @returns Either the matching element, or `undefined` if no elements match. | ||
| */ | ||
| export function itsMatch<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): T | undefined; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Applies a function against an accumulator and each element of the given `iterable` to reduce elements to a single | ||
| * value. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @typeParam TResult - A type of reduced value. | ||
| * @param iterable - An iterable to reduce values of. | ||
| * @param reducer - A function to apply the value returned from the previous `reducer` call and to each element. | ||
| * @param initialValue - Initial value passed to the first `reducer` call. | ||
| * | ||
| * @returns Reduced value returned from the last `reducer` call, or `initialValue` if there is no elements in the given | ||
| * `iterable`. | ||
| */ | ||
| export function itsReduction<T, TResult>(iterable: Iterable<T>, reducer: (this: void, prev: TResult, element: T) => TResult, initialValue: TResult): TResult; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Tests whether at least one element of the given `iterable` passes the test implemented by the provided function. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * @param iterable - An iterable to test elements of. | ||
| * @param test - A predicate function to test each element. Returns `false` to continue tests, or `true` to stop it | ||
| * and return `true` from the method call. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns `true` if the callback function returned a truthy value for at least one element in the array, or `false` | ||
| * otherwise. Returns `false` for empty iterable. | ||
| */ | ||
| export function itsSome<T>(iterable: Iterable<T>, test: (this: void, element: T) => boolean): boolean; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Object property entry. | ||
| * | ||
| * This is a tuple consisting of property key and value. | ||
| * | ||
| * @typeParam TObj - Object type. | ||
| * @typeParam TKey - A type of object property keys. | ||
| */ | ||
| export type ObjectEntry<TObj, TKey extends keyof TObj = keyof TObj> = readonly [ | ||
| TKey, | ||
| TObj[TKey] | ||
| ]; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over keys of the given object. | ||
| * | ||
| * A list of keys is constructed using `Reflect.ownKeys()`. | ||
| * | ||
| * @typeParam TObj - Source object type. | ||
| * @param source - An object to select keys from. | ||
| * | ||
| * @returns New push iterable over own object keys retrieved by `Reflect.ownKeys()`. | ||
| */ | ||
| export function overKeys<TObj extends object>(source: TObj): PushIterable<keyof TObj>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable push iterable} with all `array` elements extending the given type. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @typeParam TTarget - Target type. | ||
| * @param array - A source array. | ||
| * @param test - A predicate function to test that element extends the type `TTarget`. Returns `true` to keep the | ||
| * element, or `false` otherwise. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterArray<T, TTarget extends T>(array: ArrayLike<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `array` elements that pass the test implemented by | ||
| * the provided function. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @param array - A source array. | ||
| * @param test - A predicate function to test each element. Returns `true` to keep the element, or `false` otherwise. | ||
| * It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterArray<T>(array: ArrayLike<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all items of the given indexed list that extend the given type. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @typeParam TTarget - Target type. | ||
| * @param indexed - A source indexed items list. | ||
| * @param test - A predicate function to test that item extends the type `TTarget`. Returns `true` to keep the element, | ||
| * or `false` otherwise. It accepts the tested item as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIndexed<T, TTarget extends T>(indexed: IndexedItemList<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all items of the given indexed list that pass the test | ||
| * implemented by the provided function. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @param indexed - A source indexed items list. | ||
| * @param test - A predicate function to test each item. Returns `true` to keep the item, or `false` otherwise. | ||
| * It accepts the tested item as the only parameter. | ||
| * | ||
| * @returns New push iterable with the items that pass the test. If no items passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIndexed<T>(indexed: IndexedItemList<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `source` iterable elements extending the given type. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @typeParam TTarget - Target type. | ||
| * @param source - A source iterable. | ||
| * @param test - A predicate function to test that element extends the type `TTarget`. Returns `true` to keep the | ||
| * element, or`false` otherwise. It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIt<T, TTarget extends T>(source: Iterable<T>, test: (this: void, element: T) => element is TTarget): PushIterable<TTarget>; | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with all `source` iterable elements that pass the test implemented by | ||
| * the provided function. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @param source - A source iterable. | ||
| * @param test - A predicate function to test each element. Returns `true` to keep the element, or `false` otherwise. | ||
| * It accepts the tested element as the only parameter. | ||
| * | ||
| * @returns New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable | ||
| * will be returned. | ||
| */ | ||
| export function filterIt<T>(source: Iterable<T>, test: (this: void, element: T) => boolean): PushIterable<T>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source `array` of iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapArray(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param array - A source array-like instance of iterables. | ||
| * | ||
| * @returns New push iterable with each element of `array` being flattened. | ||
| */ | ||
| export function flatMapArray<T>(array: ArrayLike<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each element of the source `array` using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of array elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param array - A source array-like instance of elements to convert. | ||
| * @param convert - A function that produces new iterable, taking array element as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapArray<TSrc, TConv>(array: ArrayLike<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source list of indexed iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapIndexed(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param indexed - A source list of indexed iterables. | ||
| * | ||
| * @returns New push iterable with each element of indexed list being flattened. | ||
| */ | ||
| export function flatMapIndexed<T>(indexed: IndexedItemList<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each item of the source indexed list using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of indexed items. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param indexed - A source list of indexed items to convert. | ||
| * @param convert - A function that produces new iterable, taking the list item as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapIndexed<TSrc, TConv>(indexed: IndexedItemList<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Flattens the source iterable of iterables into new {@link PushIterable | push iterable}. | ||
| * | ||
| * Calling this function is the same as calling `flatMapIt(source, element => element)`. | ||
| * | ||
| * @typeParam T - A type of converted elements. | ||
| * @param source - A source iterable of iterables. | ||
| * | ||
| * @returns New push iterable with each element of `source` being flattened. | ||
| */ | ||
| export function flatMapIt<T>(source: Iterable<Iterable<T>>): PushIterable<T>; | ||
| /** | ||
| * First maps each element of the `source` iterable using a mapping function, then flattens the result into new | ||
| * {@link PushIterable | push iterable}. | ||
| * | ||
| * @typeParam TSrc - A type of source elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param source - A source iterable of elements to convert. | ||
| * @param convert - A function that produces new iterable, taking the source element as the only parameter. | ||
| * | ||
| * @returns New push iterable with each element being the flattened result of the `convert` function call. | ||
| */ | ||
| export function flatMapIt<TSrc, TConv>(source: Iterable<TSrc>, convert: (this: void, element: TSrc) => Iterable<TConv>): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every element | ||
| * of the given `array`. | ||
| * | ||
| * @typeParam TSrc - A type of array elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param array - A source array-like instance. | ||
| * @param convert - A function that produces an element of new iterable, taking array element as the only parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapArray<TSrc, TConv>(array: ArrayLike<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every item of the | ||
| * given indexed list. | ||
| * | ||
| * @typeParam TSrc - A type of indexed list items. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param indexed - A source indexed items list. | ||
| * @param convert - A function that produces an element of new iterable, taking list item as the only parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapIndexed<TSrc, TConv>(indexed: IndexedItemList<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the results of calling a provided function on every element | ||
| * of the `source` iterable. | ||
| * | ||
| * @typeParam TSrc - A type of source elements. | ||
| * @typeParam TConv - A type of converted elements. | ||
| * @param source - A source iterable. | ||
| * @param convert - A function that produces an element of the new iterable, taking the source element as the only | ||
| * parameter. | ||
| * | ||
| * @returns New push iterable of transformed elements. | ||
| */ | ||
| export function mapIt<TSrc, TConv>(source: Iterable<TSrc>, convert: (this: void, element: TSrc) => TConv): PushIterable<TConv>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of elements of the given `array`. | ||
| * | ||
| * Element value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered | ||
| * out. | ||
| * | ||
| * This can be used as a more effective {@link mapArray} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - A type of array elements. | ||
| * @typeParam TValue - A type of array element values. | ||
| * @param array - A source array. | ||
| * @param valueOf - A function that values elements, taking the source element as the only parameter, and returning | ||
| * either its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with array element values. | ||
| */ | ||
| export function valueArray<T, TValue = T>(array: ArrayLike<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of items of the given indexed list. | ||
| * | ||
| * Item value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered out. | ||
| * | ||
| * This can be used as a more effective {@link mapIndexed} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - Indexed items type. | ||
| * @typeParam TValue - A type of item values. | ||
| * @param indexed - A source indexed items list. | ||
| * @param valueOf - A function that values items, taking the source item as the only parameter, and returning either | ||
| * its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with the item values. | ||
| */ | ||
| export function valueIndexed<T, TValue = T>(indexed: IndexedItemList<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} with the values of elements of the `source` iterable. | ||
| * | ||
| * Element value is the result of provided function call, except `false`, `null`, and `undefined` which are filtered | ||
| * out. | ||
| * | ||
| * This can be used as a more effective {@link mapIt} / {@link filterIt} combination. | ||
| * | ||
| * @typeParam T - A type of source elements. | ||
| * @typeParam TValue - A type of source element values. | ||
| * @param source - A source iterable. | ||
| * @param valueOf - A function that values elements, taking the source element as the only parameter, and returning | ||
| * either its value, or `false`/`null`/`undefined` to filter it out. | ||
| * | ||
| * @returns New push iterable with the element values. | ||
| */ | ||
| export function valueIt<T, TValue = T>(source: Iterable<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
| declare module "@proc7ts/push-iterator" { | ||
| /** | ||
| * Creates a {@link PushIterable | push iterable} over the property key/value entries of the given object. | ||
| * | ||
| * A list of keys is constructed using `Reflect.ownKeys()`. | ||
| * | ||
| * @typeParam TObj - Object type. | ||
| * | ||
| * @param source - An object to select keys and values from. | ||
| * | ||
| * @returns New push iterable of object property entries. | ||
| */ | ||
| export function overEntries<TObj extends object>(source: TObj): PushIterable<ObjectEntry<TObj>>; | ||
| } | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"sources":["src/push-iteration-mode.ts","src/push-iterator.ts","src/push-iterable.ts","src/base/is-push-iterable.ts","src/base/iterator-of.ts","src/base/make-push-iterable.ts","src/base/make-push-iterator.ts","src/construction/over-array.ts","src/base/iterate-it.ts","src/construction/over-iterator.ts","src/construction/over-iterable.ts","src/construction/over-elements-of.ts","src/construction/over-indexed.ts","src/construction/over-none.ts","src/construction/over-one.ts","src/construction/over-many.ts","src/construction/reverse-array.ts","src/consumption/its-each.ts","src/consumption/its-elements.ts","src/consumption/its-empty.ts","src/consumption/its-every.ts","src/consumption/its-find.ts","src/consumption/its-first.ts","src/consumption/its-iterator.ts","src/consumption/its-match.ts","src/consumption/its-reduction.ts","src/consumption/its-some.ts","src/objects/object-entry.ts","src/objects/over-keys.ts","src/transformation/filter-array.ts","src/transformation/filter-indexed.ts","src/transformation/filter-it.ts","src/transformation/flat-map-array.ts","src/transformation/flat-map-indexed.ts","src/transformation/flat-map-it.ts","src/transformation/map-array.ts","src/transformation/map-indexed.ts","src/transformation/map-it.ts","src/transformation/value-array.ts","src/transformation/value-indexed.ts","src/transformation/value-it.ts","src/objects/over-entries.ts"],"names":[],"mappings":";;;;;;;;IAMA,MAAM,YAAY,iBAAiB;;;;;;QAOjC,IAAI,GAAA,CAAI;;;;;;QAOR,IAAI,GAAA,CAAI;;;;;;;QAQR,IAAI,GAAA,CAAI;;;;;;;QAQR,GAAG,GAAA,CAAI;KAER;;;;;;;;;IC/BD,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,QAAQ,gBAAgB,GAAG,iBAAiB;QAE3E,CAAC,MAAM,SAAS,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;;;;;;QAOrC,MAAM,IAAI,OAAO,CAAC;KAEnB;IAED,MAAM,WAAW,YAAY,CAAC;;;;;;;;;;;QAY5B,KAAY,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;;;;;;;;QASrE,KAAY,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;;;;;;;QAQhE,KAAY,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;;;;;;;;;;;;;;;;;QAkB/D,KAAY,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;KAEvE;;;;;;;IC/DD,MAAM,2CAAsE;;;;;;IAO5E,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;;;;;;QAOlD,CAAC,MAAM,S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UAAU,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,EACpC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GACvE,YAAY,CAAC,MAAM,CAAC,CAEtB;;;;;;;;;;;;;;;;;;;ICLD,MAAM,UAAU,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,EACtC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GACvE,YAAY,CAAC,MAAM,CAAC,CAEtB;;;;;;;;;;;;;;;;;;;;ICFD,MAAM,UAAU,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,EACjC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GACvE,YAAY,CAAC,MAAM,CAAC,CA6BtB;;;;;;;;;;;;;;;ICxCD,MAAM,UAAU,WAAW,CAAC,IAAI,SAAS,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAK9F","file":"index.d.ts","sourceRoot":""} |
| import commonjs from '@rollup/plugin-commonjs'; | ||
| import nodeResolve from '@rollup/plugin-node-resolve'; | ||
| import { externalModules } from '@run-z/rollup-helpers'; | ||
| import { defineConfig } from 'rollup'; | ||
| import sourcemaps from 'rollup-plugin-sourcemaps'; | ||
| import ts from 'rollup-plugin-typescript2'; | ||
| import typescript from 'typescript'; | ||
| export default defineConfig({ | ||
| input: './src/benchmarks/main.ts', | ||
| plugins: [ | ||
| commonjs(), | ||
| ts({ | ||
| typescript, | ||
| tsconfig: 'tsconfig.benchmark.json', | ||
| cacheRoot: 'target/.rts2_cache', | ||
| useTsconfigDeclarationDir: true, | ||
| }), | ||
| nodeResolve(), | ||
| sourcemaps(), | ||
| ], | ||
| external: externalModules(), | ||
| output: { | ||
| format: 'esm', | ||
| sourcemap: true, | ||
| file: './target/benchmark.js', | ||
| }, | ||
| }); |
| import nodeResolve from '@rollup/plugin-node-resolve'; | ||
| import { externalModules } from '@run-z/rollup-helpers'; | ||
| import path from 'path'; | ||
| import { defineConfig } from 'rollup'; | ||
| import flatDts from 'rollup-plugin-flat-dts'; | ||
| import sourcemaps from 'rollup-plugin-sourcemaps'; | ||
| import ts from 'rollup-plugin-typescript2'; | ||
| import typescript from 'typescript'; | ||
| export default defineConfig({ | ||
| input: { | ||
| 'push-iterator': './src/index.ts', | ||
| 'push-iterator.call-thru': './src/call-thru/index.ts', | ||
| }, | ||
| plugins: [ | ||
| ts({ | ||
| typescript, | ||
| tsconfig: 'tsconfig.main.json', | ||
| cacheRoot: 'target/.rts2_cache', | ||
| }), | ||
| nodeResolve(), | ||
| sourcemaps(), | ||
| ], | ||
| external: externalModules(), | ||
| manualChunks(id) { | ||
| if (id.startsWith(path.resolve('src', 'call-thru') + path.sep)) { | ||
| return 'push-iterator.call-thru'; | ||
| } | ||
| return 'push-iterator'; | ||
| }, | ||
| output: { | ||
| format: 'esm', | ||
| sourcemap: true, | ||
| dir: '.', | ||
| entryFileNames: 'dist/[name].js', | ||
| chunkFileNames: 'dist/_[name].js', | ||
| hoistTransitiveImports: false, | ||
| plugins: [ | ||
| flatDts({ | ||
| tsconfig: 'tsconfig.main.json', | ||
| lib: true, | ||
| compilerOptions: { | ||
| declarationMap: true, | ||
| }, | ||
| entries: { | ||
| 'call-thru': { | ||
| file: 'call-thru/index.d.ts', | ||
| }, | ||
| }, | ||
| internal: ['**/impl/**', '**/*.impl'], | ||
| }), | ||
| ], | ||
| }, | ||
| }); |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2
-71.43%170890
-33.21%13
-7.14%2188
-3.91%244
-7.22%1
Infinity%