1
0

sync local repositories

add booleanish predicates
enable custom inspection
default to sequence of any when sequence type is unknown
This commit is contained in:
2024-08-15 00:40:45 +02:00
parent aedad87c8e
commit 0b03475f66
7 changed files with 543 additions and 196 deletions

View File

@@ -2,7 +2,7 @@ import { wrap as wrapSync } from "../sync/index.js";
import { Sequence } from "../sync/types.js";
import { MaybeAsyncGenerator, MaybeAsyncIterable, MaybePromiseLike } from "../types.js";
import { isAsyncIterable } from "../utils.js";
import { WrappedSequence, WrappedAsyncIterable, WrappedObjectAsync, WrappedArrayAsync, WrappedArrayLikeAsync, FunctionAsyncSequence, GeneratorAsyncSequence, RangeAsyncSequence, RepeatForeverAsyncSequence, RepeatAsyncSequence, AsyncSequenceMarker, EMPTY } from "./impl.js";
import { WrappedSequence, WrappedAsyncIterable, WrappedObjectAsync, WrappedArrayAsync, WrappedArrayLikeAsync, FunctionAsyncSequence, GeneratorAsyncSequence, RangeAsyncSequence, RepeatForeverAsyncSequence, RepeatAsyncSequence, AsyncSequenceMarker, EMPTY, ConcatAsyncSequence } from "./impl.js";
import { AsyncSequence } from "./types.js";
export function asAsync<T>(sequence: Sequence<MaybePromiseLike<T>>): AsyncSequence<T> {
@@ -52,6 +52,10 @@ export function of<T>(...elements: MaybePromiseLike<T>[]): AsyncSequence<T> {
}
}
export function concat<T>(...sequences: AsyncSequence<T>[]): AsyncSequence<T> {
return new ConcatAsyncSequence<T>(sequences);
}
export function func<T>(f: () => MaybePromiseLike<T>): AsyncSequence<T> {
return new FunctionAsyncSequence(f);
}