@proc7ts/push-iterator
Advanced tools
+343
-204
@@ -41,3 +41,3 @@ /** | ||
| return true; | ||
| }); | ||
| }, 1 /* Next */); | ||
| if (result) { | ||
@@ -54,3 +54,3 @@ return result; | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](_accept) { | ||
| [PushIterator__symbol](_accept, _mode) { | ||
| return this; | ||
@@ -64,3 +64,3 @@ }, | ||
| } | ||
| function PushIterator$dontIterate(_accept) { | ||
| function PushIterator$dontIterate(_accept, _mode) { | ||
| // Do not iterate | ||
@@ -99,61 +99,85 @@ } | ||
| function indexedItemOf(indexed, index) { | ||
| function indexed$itemOf(indexed, index) { | ||
| return indexed.item(index); // The index is always valid. | ||
| } | ||
| function iterateOverIndexed(indexed, elementOf) { | ||
| return accept => { | ||
| let i = 0; | ||
| const forNext = (accept) => { | ||
| if (i >= indexed.length) { | ||
| 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; | ||
| } | ||
| for (;;) { | ||
| const goOn = accept(elementOf(indexed, i++)); | ||
| if (i >= indexed.length || goOn === false) { | ||
| return false; | ||
| } | ||
| if (goOn === true) { | ||
| return true; | ||
| } | ||
| if (goOn === true) { | ||
| return true; | ||
| } | ||
| }; | ||
| } | ||
| }; | ||
| if (accept && !forNext(accept)) { | ||
| return PushIterator$empty; | ||
| } | ||
| let over = false; | ||
| let iterate = (accept) => { | ||
| 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; | ||
| // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
| next = PushIterator$noNext; | ||
| return { done: true }; | ||
| }; | ||
| return { | ||
| [Symbol.iterator]: PushIterator$iterator, | ||
| [PushIterator__symbol](accept) { | ||
| iterate(accept); | ||
| return this; | ||
| }, | ||
| next: () => next(), | ||
| isOver: () => over, | ||
| }; | ||
| } | ||
| }; | ||
| 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 arrayElementOf(array, index) { | ||
| function arrayLike$elementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| function iterateOverArray(array) { | ||
| return iterateOverIndexed(array, arrayElementOf); | ||
| 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); | ||
| } | ||
@@ -169,6 +193,22 @@ /** | ||
| function overArray(array) { | ||
| return makePushIterable(iterateOverArray(array)); | ||
| return makePushIterable(arrayLike$iterate(array)); | ||
| } | ||
| function toPushIterator(it, forNext) { | ||
| 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; | ||
@@ -203,3 +243,3 @@ let iterate = (accept) => { | ||
| } | ||
| function rawIteratorPusher(it) { | ||
| function iterator$pusher(it) { | ||
| return accept => { | ||
@@ -229,2 +269,3 @@ for (;;) { | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
@@ -234,34 +275,92 @@ * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| */ | ||
| function iterateIt(iterable, accept) { | ||
| function iterateIt(iterable, accept, mode = 0 /* Some */) { | ||
| if (isPushIterable(iterable)) { | ||
| return iterable[PushIterator__symbol](accept); | ||
| return iterable[PushIterator__symbol](accept, mode); | ||
| } | ||
| if (Array.isArray(iterable)) { | ||
| return iterateIt$array(iterable, accept); | ||
| return iterateIt$array(iterable, accept, mode); | ||
| } | ||
| return iterateIt$raw(iterable, accept); | ||
| return iterateIt$raw(iterable, accept, mode); | ||
| } | ||
| function iterateIt$array(array, accept) { | ||
| return array.length ? iterateOverArray(array)(accept) : PushIterator$empty; | ||
| 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) { | ||
| 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); | ||
| return it[PushIterator__symbol](accept, mode); | ||
| } | ||
| const forEach = rawIteratorPusher(it); | ||
| return forEach(accept) ? toPushIterator(it, forEach) : PushIterator$empty; | ||
| const forEach = iterator$pusher(it); | ||
| return forEach(accept) | ||
| ? iterator$convert(it, forEach) | ||
| : PushIterator$empty; | ||
| } | ||
| /** | ||
| * Returns a {@link PushIterator push iterator} without elements. | ||
| * | ||
| * @typeParam T - Iterated elements type. | ||
| * | ||
| * @returns Empty push iterator instance. | ||
| */ | ||
| function overNone() { | ||
| 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]; | ||
| } | ||
| /** | ||
@@ -276,12 +375,14 @@ * Creates a {@link PushIterable | push iterable} over elements of iterator created by the given function. | ||
| function overIterator(iterate) { | ||
| return makePushIterable(iterateOverRawIterator(iterate)); | ||
| return makePushIterable(overIterator$iterate(iterate)); | ||
| } | ||
| function iterateOverRawIterator(iterate) { | ||
| return accept => { | ||
| function overIterator$iterate(iterate) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| const it = iterate(); | ||
| if (isPushIterable(it)) { | ||
| return it[PushIterator__symbol](accept); | ||
| return it[PushIterator__symbol](accept, mode); | ||
| } | ||
| const forNext = rawIteratorPusher(it); | ||
| return accept && !forNext(accept) ? overNone() : toPushIterator(it, forNext); | ||
| const forNext = iterator$pusher(it); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : iterator$convert(it, forNext); | ||
| }; | ||
@@ -314,33 +415,5 @@ } | ||
| return sources.length > 1 | ||
| ? makePushIterable(overElementsOf$(sources)) | ||
| : (sources.length | ||
| ? overIterable(sources[0]) | ||
| : overNone()); | ||
| ? flatMapArray$(sources, flatMapArray$defaultElementOf) | ||
| : (sources.length ? overIterable(sources[0]) : PushIterator$empty); | ||
| } | ||
| function overElementsOf$(sources) { | ||
| return accept => { | ||
| let i = 0; | ||
| let src = sources[0]; | ||
| const forNext = (accept) => { | ||
| for (;;) { | ||
| // eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
| let status; | ||
| const srcTail = iterateIt(src, element => status = accept(element)); | ||
| if (srcTail.isOver()) { | ||
| if (++i >= sources.length) { | ||
| return false; | ||
| } | ||
| src = sources[i]; | ||
| } | ||
| else { | ||
| src = srcTail; | ||
| } | ||
| if (typeof status === 'boolean') { | ||
| return status; | ||
| } | ||
| } | ||
| }; | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| }; | ||
| } | ||
@@ -356,6 +429,17 @@ /** | ||
| function overIndexed(indexed) { | ||
| return makePushIterable(iterateOverIndexed(indexed, indexedItemOf)); | ||
| return makePushIterable(indexed$iterate(indexed, indexed$itemOf)); | ||
| } | ||
| /** | ||
| * 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. | ||
@@ -375,3 +459,3 @@ * | ||
| accept(value); | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -383,3 +467,3 @@ let over = false; | ||
| if (over) { | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -389,3 +473,3 @@ if (accept) { | ||
| accept(value); | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -431,6 +515,9 @@ return this; | ||
| function reverseArray(array) { | ||
| return makePushIterable(iterateOverArrayReversely(array)); | ||
| return makePushIterable(reverseArray$iterate(array)); | ||
| } | ||
| function iterateOverArrayReversely(array) { | ||
| return accept => { | ||
| function reverseArray$iterate(array) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| return reverseArray$process(array, accept, mode); | ||
| } | ||
| let i = array.length - 1; | ||
@@ -452,3 +539,3 @@ const forNext = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -484,2 +571,17 @@ let over = false; | ||
| } | ||
| function reverseArray$process(array, accept, mode /* PushIterationMode.Only | PushIterationMode.All */) { | ||
| if (mode === 2 /* All */) { | ||
| for (let i = array.length - 1; i >= 0; --i) { | ||
| accept(array[i]); | ||
| } | ||
| } | ||
| else { | ||
| for (let i = array.length - 1; i >= 0; --i) { | ||
| if (accept(array[i]) === false) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| return PushIterator$empty; | ||
| } | ||
@@ -495,3 +597,3 @@ /** | ||
| function itsEach(iterable, action) { | ||
| iterateIt(iterable, element => { action(element); }); | ||
| iterateIt(iterable, element => { action(element); }, 2 /* All */); | ||
| } | ||
@@ -513,3 +615,3 @@ | ||
| const result = []; | ||
| it[PushIterator__symbol](element => { result.push(convert(element)); }); | ||
| it[PushIterator__symbol](element => { result.push(convert(element)); }, 2 /* All */); | ||
| return result; | ||
@@ -536,3 +638,3 @@ } | ||
| let isEmpty = true; | ||
| it[PushIterator__symbol](_element /* Unused parameter to prevent deoptimization */ => isEmpty = false); | ||
| it[PushIterator__symbol](_element => isEmpty = false, 1 /* Only */); | ||
| return isEmpty; | ||
@@ -557,3 +659,3 @@ } | ||
| return allMatch ? void 0 : false; | ||
| }); | ||
| }, 1 /* Only */); | ||
| return allMatch; | ||
@@ -582,3 +684,3 @@ } | ||
| } | ||
| }); | ||
| }, 1 /* Only */); | ||
| return find; | ||
@@ -607,3 +709,3 @@ } | ||
| return false; | ||
| }); | ||
| }, 1 /* Only */); | ||
| return first; | ||
@@ -628,3 +730,3 @@ } | ||
| ? it | ||
| : toPushIterator(it, rawIteratorPusher(it)); | ||
| : iterator$convert(it, iterator$pusher(it)); | ||
| } | ||
@@ -649,3 +751,3 @@ | ||
| } | ||
| }); | ||
| }, 1 /* Only */); | ||
| return match; | ||
@@ -669,3 +771,3 @@ } | ||
| let reduced = initialValue; | ||
| iterateIt(iterable, element => { reduced = reducer(reduced, element); }); | ||
| iterateIt(iterable, element => { reduced = reducer(reduced, element); }, 2 /* All */); | ||
| return reduced; | ||
@@ -690,3 +792,3 @@ } | ||
| return someMatches ? false : void 0; | ||
| }); | ||
| }, 1 /* Only */); | ||
| return someMatches; | ||
@@ -709,4 +811,7 @@ } | ||
| function iterateOverFilteredIndexed(indexed, elementOf, test) { | ||
| return accept => { | ||
| function filterIndexed$(indexed, elementOf, test) { | ||
| return (accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| return indexed$process(indexed, elementOf, element => test(element) ? accept(element) : void 0, mode); | ||
| } | ||
| let i = 0; | ||
@@ -728,3 +833,3 @@ const forNext = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -767,23 +872,27 @@ let over = false; | ||
| function filterArray(array, test) { | ||
| return makePushIterable(iterateOverFilteredIndexed(array, arrayElementOf, test)); | ||
| return makePushIterable(filterIndexed$(array, arrayLike$elementOf, test)); | ||
| } | ||
| function filterIndexed(indexed, test) { | ||
| return makePushIterable(iterateOverFilteredIndexed(indexed, indexedItemOf, test)); | ||
| return makePushIterable(filterIndexed$(indexed, indexed$itemOf, test)); | ||
| } | ||
| function filterIt(source, test) { | ||
| return makePushIterable(accept => { | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| const acceptElement = (element) => test(element) ? accept(element) : void 0; | ||
| return isPushIterable(source) | ||
| ? source[PushIterator__symbol](acceptElement, mode) // Iteration over. | ||
| : iterable$process(source, acceptElement, mode); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? filterIt$(source, test) | ||
| : filterIt$raw(source, test); | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function filterIt$(source, test) { | ||
| return accept => { | ||
| const tail = source[PushIterator__symbol](element => test(element) ? accept(element) : void 0); | ||
| source = tail; | ||
| return !tail.isOver(); | ||
| }; | ||
| return accept => !(source = source[PushIterator__symbol](element => test(element) ? accept(element) : void 0)).isOver(); | ||
| } | ||
@@ -812,45 +921,10 @@ function filterIt$raw(source, test) { | ||
| function iterateOverFlattenedIndexed(indexed, elementsOf) { | ||
| return accept => { | ||
| 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) ? overNone() : makePushIterator(forNext); | ||
| }; | ||
| } | ||
| function flatMapArray(array, convert) { | ||
| return makePushIterable(iterateOverFlattenedIndexed(array, convert | ||
| return flatMapArray$(array, convert | ||
| ? (array, index) => convert(array[index]) | ||
| : flatMapArray$defaultElementOf)); | ||
| : flatMapArray$defaultElementOf); | ||
| } | ||
| function flatMapArray$defaultElementOf(array, index) { | ||
| return array[index]; | ||
| } | ||
| function flatMapIndexed(indexed, convert) { | ||
| return makePushIterable(iterateOverFlattenedIndexed(indexed, convert | ||
| return makePushIterable(flatMapIndexed$(indexed, convert | ||
| ? (indexed, index) => convert(indexed.item(index)) | ||
@@ -864,10 +938,17 @@ : flatMapIndexed$defaultElementOf)); | ||
| function flatMapIt(source, convert = flatMapIt$defaultConverter) { | ||
| return makePushIterable(accept => { | ||
| 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) | ||
| ? flatMap$(source, convert) | ||
| : flatMap$raw(source, convert); | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| ? flatMapIt$(source, convert) | ||
| : flatMapIt$raw(source, convert); | ||
| return accept && !forNext(accept) | ||
| ? overNone() | ||
| : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function flatMap$(source, convert) { | ||
| function flatMapIt$(source, convert) { | ||
| let subs; | ||
@@ -907,6 +988,6 @@ let lastSrc = false; | ||
| } | ||
| function flatMap$raw(source, convert) { | ||
| function flatMapIt$raw(source, convert) { | ||
| const it = source[Symbol.iterator](); | ||
| if (isPushIterable(it)) { | ||
| return flatMap$(it, convert); | ||
| return flatMapIt$(it, convert); | ||
| } | ||
@@ -933,2 +1014,36 @@ let subs; | ||
| } | ||
| 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) { | ||
@@ -950,3 +1065,3 @@ return element; | ||
| function mapArray(array, convert) { | ||
| return makePushIterable(iterateOverIndexed(array, (array, index) => convert(array[index]))); | ||
| return makePushIterable(indexed$iterate(array, (array, index) => convert(array[index]))); | ||
| } | ||
@@ -966,3 +1081,3 @@ | ||
| function mapIndexed(indexed, convert) { | ||
| return makePushIterable(iterateOverIndexed(indexed, (list, index) => convert(list.item(index) /* The index is always valid */))); | ||
| return makePushIterable(indexed$iterate(indexed, (list, index) => convert(list.item(index) /* The index is always valid */))); | ||
| } | ||
@@ -983,13 +1098,19 @@ | ||
| function mapIt(source, convert) { | ||
| return makePushIterable(accept => { | ||
| const forNext = isPushIterable(source) ? mapIt$(source, convert) : mapIt$raw(source, convert); | ||
| return accept && !forNext(accept) ? overNone() : makePushIterator(forNext); | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| const acceptElement = (element) => accept(convert(element)); | ||
| return isPushIterable(source) | ||
| ? source[PushIterator__symbol](acceptElement, mode) // Iteration over. | ||
| : iterable$process(source, acceptElement, mode); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? mapIt$(source, convert) | ||
| : mapIt$raw(source, convert); | ||
| return accept && !forNext(accept) | ||
| ? overNone() | ||
| : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function mapIt$(source, convert) { | ||
| return accept => { | ||
| const tail = source[PushIterator__symbol](element => accept(convert(element))); | ||
| source = tail; | ||
| return !tail.isOver(); | ||
| }; | ||
| return accept => !(source = source[PushIterator__symbol](element => accept(convert(element)))).isOver(); | ||
| } | ||
@@ -1015,4 +1136,7 @@ function mapIt$raw(source, convert) { | ||
| function iterateOverValuedIndexed(indexed, elementOf, valueOf) { | ||
| return accept => { | ||
| function valueIndexed$(indexed, elementOf, valueOf) { | ||
| return (accept, mode = 0 /* 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); | ||
| } | ||
| let i = 0; | ||
@@ -1034,3 +1158,3 @@ const forNext = (accept) => { | ||
| if (accept && !forNext(accept)) { | ||
| return overNone(); | ||
| return PushIterator$empty; | ||
| } | ||
@@ -1089,3 +1213,3 @@ let over = false; | ||
| function valueArray(array, valueOf) { | ||
| return makePushIterable(iterateOverValuedIndexed(array, arrayElementOf, valueOf)); | ||
| return makePushIterable(valueIndexed$(array, arrayLike$elementOf, valueOf)); | ||
| } | ||
@@ -1109,3 +1233,3 @@ | ||
| function valueIndexed(indexed, valueOf) { | ||
| return makePushIterable(iterateOverValuedIndexed(indexed, indexedItemOf, valueOf)); | ||
| return makePushIterable(valueIndexed$(indexed, indexed$itemOf, valueOf)); | ||
| } | ||
@@ -1130,14 +1254,29 @@ | ||
| function valueIt(source, valueOf) { | ||
| const forNext = isPushIterable(source) ? valueIt$(source, valueOf) : valueIt$raw(source, valueOf); | ||
| return makePushIterable(accept => accept && !forNext(accept) ? overNone() : makePushIterator(forNext)); | ||
| return makePushIterable((accept, mode = 0 /* Some */) => { | ||
| if (accept && mode > 0) { | ||
| const acceptElement = (element) => { | ||
| const value = valueOf(element); | ||
| return value != null && value !== false | ||
| ? accept(value) | ||
| : void 0; | ||
| }; | ||
| return isPushIterable(source) | ||
| ? source[PushIterator__symbol](acceptElement, mode) // Iteration over. | ||
| : iterable$process(source, acceptElement, mode); | ||
| } | ||
| const forNext = isPushIterable(source) | ||
| ? valueIt$(source, valueOf) | ||
| : valueIt$raw(source, valueOf); | ||
| return accept && !forNext(accept) | ||
| ? PushIterator$empty | ||
| : makePushIterator(forNext); | ||
| }); | ||
| } | ||
| function valueIt$(source, valueOf) { | ||
| return accept => { | ||
| const tail = source[PushIterator__symbol](element => { | ||
| const value = valueOf(element); | ||
| return value != null && value !== false ? accept(value) : void 0; | ||
| }); | ||
| source = tail; | ||
| return !tail.isOver(); | ||
| }; | ||
| return accept => !(source = source[PushIterator__symbol](element => { | ||
| const value = valueOf(element); | ||
| return value != null && value !== false | ||
| ? accept(value) | ||
| : void 0; | ||
| })).isOver(); | ||
| } | ||
@@ -1144,0 +1283,0 @@ function valueIt$raw(source, valueOf) { |
+63
-30
| /// <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. | ||
@@ -22,5 +59,2 @@ * | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| type Pusher<T> = | ||
| /** | ||
| * @param accept - A function to push iterated elements to. Accepts iterated element as its only parameter. May return | ||
@@ -30,5 +64,5 @@ * `false` to stop iteration. | ||
| * @returns `true` if further iteration is possible, or `false` if there is no more elements left to iterate. | ||
| * The former is possible only when iteration stopped, i.e. `accept` returned `false`. | ||
| * The latter is possible only when iteration aborted, i.e. `accept` returned `false`. | ||
| */ | ||
| (this: void, accept: Acceptor<T>) => boolean; | ||
| type Pusher<T> = (this: void, accept: Acceptor<T>) => boolean; | ||
| /** | ||
@@ -46,8 +80,5 @@ * A signature of a function accepting iterated elements. | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| type EachAcceptor<T> = | ||
| /** | ||
| * @param element - Iterated element. | ||
| */ | ||
| (this: void, element: T) => void; | ||
| type EachAcceptor<T> = (this: void, element: T) => void; | ||
| /** | ||
@@ -65,5 +96,2 @@ * A signature of a function accepting iterated elements and able to suspend or stop further iteration. | ||
| * @typeParam T - Iterated elements type. | ||
| */ | ||
| type StoppingAcceptor<T> = | ||
| /** | ||
| * @param element - Iterated element. | ||
@@ -73,3 +101,3 @@ * | ||
| */ | ||
| (this: void, element: T) => boolean; | ||
| type StoppingAcceptor<T> = (this: void, element: T) => boolean; | ||
| } | ||
@@ -108,2 +136,4 @@ } | ||
| * `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. | ||
| * | ||
@@ -113,3 +143,3 @@ * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| */ | ||
| [PushIterator__symbol](accept?: PushIterator.Acceptor<T>): PushIterator<T>; | ||
| [PushIterator__symbol](accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
@@ -126,2 +156,4 @@ export namespace PushIterable { | ||
| * `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. | ||
| * | ||
@@ -131,3 +163,3 @@ * @returns A push iterator instance to continue iteration with. If `accept` returned `false` then further iteration | ||
| */ | ||
| type Iterate<T> = (this: void, accept?: PushIterator.Acceptor<T>) => PushIterator<T>; | ||
| type Iterate<T> = (this: void, accept?: PushIterator.Acceptor<T>, mode?: PushIterationMode) => PushIterator<T>; | ||
| } | ||
@@ -244,2 +276,3 @@ } | ||
| * `true` to suspend iteration, or `false` to stop it. | ||
| * @param mode - Optional iteration mode hint declaring what `accept` function shall do. | ||
| * | ||
@@ -249,3 +282,3 @@ * @returns A push iterator instance representing the tail of the given iterable. This iterator can be used to continue | ||
| */ | ||
| export function iterateIt<T>(iterable: Iterable<T>, accept: PushIterator.Acceptor<T>): PushIterator<T>; | ||
| export function iterateIt<T>(iterable: Iterable<T>, accept: PushIterator.Acceptor<T>, mode?: PushIterationMode): PushIterator<T>; | ||
| } | ||
@@ -255,13 +288,2 @@ | ||
| /** | ||
| * 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 elements of iterator created by the given function. | ||
@@ -335,2 +357,13 @@ * | ||
| /** | ||
| * 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. | ||
@@ -782,3 +815,3 @@ * | ||
| */ | ||
| export function valueArray<T, TValue>(array: ArrayLike<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| export function valueArray<T, TValue = T>(array: ArrayLike<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
@@ -802,3 +835,3 @@ | ||
| */ | ||
| export function valueIndexed<T, TValue>(indexed: IndexedItemList<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| export function valueIndexed<T, TValue = T>(indexed: IndexedItemList<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
@@ -823,3 +856,3 @@ | ||
| */ | ||
| export function valueIt<T, TValue>(source: Iterable<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| export function valueIt<T, TValue = T>(source: Iterable<T>, valueOf: (this: void, element: T) => TValue | false | null | undefined): PushIterable<TValue>; | ||
| } | ||
@@ -826,0 +859,0 @@ |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["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-none.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-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":";;;;;;;IAOA,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;;;;;;QAO5B,KAAY,MAAM,CAAC,CAAC;;;;;;;;QAQhB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;;;;;;;;QASjD,KAAY,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;;;;;;QAOhE,KAAY,YAAY,CAAC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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,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;;;;;;;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":""} |
+6
-5
| { | ||
| "name": "@proc7ts/push-iterator", | ||
| "version": "3.0.0", | ||
| "version": "3.1.0", | ||
| "description": "Push iteration protocol", | ||
@@ -39,4 +39,4 @@ "keywords": [ | ||
| "@proc7ts/call-thru": "^4.4.0", | ||
| "@rollup/plugin-commonjs": "^19.0.0", | ||
| "@rollup/plugin-node-resolve": "^13.0.0", | ||
| "@rollup/plugin-commonjs": "^19.0.1", | ||
| "@rollup/plugin-node-resolve": "^13.0.2", | ||
| "@run-z/eslint-config": "^1.3.0", | ||
@@ -61,3 +61,3 @@ "@run-z/rollup-helpers": "^1.1.1", | ||
| "rollup-plugin-typescript2": "^0.30.0", | ||
| "run-z": "=1.9.1-bootstrap", | ||
| "run-z": "=1.9.2-bootstrap", | ||
| "shx": "^0.3.3", | ||
@@ -73,5 +73,6 @@ "ts-jest": "^27.0.3", | ||
| "benchmark:build": "run-z --then rollup --config rollup.benchmark.config.mjs", | ||
| "benchmark:record": "run-z benchmark:build benchmark:record:node12 benchmark:record:node14", | ||
| "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", | ||
@@ -78,0 +79,0 @@ "build": "run-z +z bootstrap", |
+24
-3
@@ -50,2 +50,23 @@ Push Iteration Protocol | ||
| Iteration Mode Hints | ||
| -------------------- | ||
| The `[PushIterator__symbol](accept?, mode?)` method of `PushIterable` interface accepts optional _iteration mode_ hint | ||
| as second parameter. The latter used to optimize iteration algorithm. Such hints provided by iterable consumption | ||
| methods. | ||
| For example, an [itsEach] function sets this hint to `PushIterationMode.All` to inform the iterable implementation that | ||
| all of its elements will be consumed. This allows to select the fastest iteration strategy without any intermediate | ||
| checks. | ||
| Another example is [itsEvery] function. It sets this hint to `PushIterationMode.Only` to inform the iterable | ||
| implementation that only some of its elements will be consumed, and then iteration will be aborted. This allows to | ||
| select iteration strategy that does not support suspend and resume. | ||
| Another mode is `PushIterationMode.Next`. It is typically set by `Iterator.next()` compatibility method. It informs that | ||
| only the next element will be consumed, after which the iteration will be suspended. | ||
| The default mode is `PushIterationMode.Some`. With this mode it is possible to suspended, resumed, or abort iteration. | ||
| Rationale | ||
@@ -84,3 +105,3 @@ --------- | ||
| The library API represented by functions. When tree-shaken the unused ones removed from bundles. | ||
| The library API represented by functions. When tree-shaken, the unused ones get removed from bundles. | ||
@@ -130,4 +151,4 @@ [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol | ||
| [`iterateIt(iterable, accept): PushIterator`][iterateIt] function iterates over the head elements of the given iterable | ||
| and returns its tail iterator. | ||
| [`iterateIt(iterable, accept): PushIterator`][iterateIt] function iterates over the leading elements of the given | ||
| iterable and returns its trailing iterator. | ||
@@ -134,0 +155,0 @@ [iterateIt]: https://proc7ts.github.io/push-iterator/modules/Module__proc7ts_push_iterator.html#iterateIt |
Sorry, the diff of this file is too big to display
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
255869
9.72%2277
8.02%263
8.68%