asynciterator
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -365,9 +365,14 @@ /** | ||
private _buffer?; | ||
protected _index: number; | ||
protected _sourceStarted: boolean; | ||
protected _truncateThreshold: number; | ||
/** | ||
Creates a new `ArrayIterator`. | ||
@param {Array} items The items that will be emitted. | ||
@param {boolean} [options.autoStart=true] Whether buffering starts directly after construction | ||
@param {boolean} [options.preserve=true] If false, the passed array can be safely modified | ||
*/ | ||
constructor(items?: Iterable<T>, { autoStart }?: { | ||
constructor(items?: Iterable<T>, { autoStart, preserve }?: { | ||
autoStart?: boolean | undefined; | ||
preserve?: boolean | undefined; | ||
}); | ||
@@ -377,2 +382,10 @@ read(): T | null; | ||
protected _destroy(cause: Error | undefined, callback: (error?: Error) => void): void; | ||
/** | ||
Consume all remaining items of the iterator into an array that will be returned asynchronously. | ||
@param {object} [options] Settings for array creation | ||
@param {integer} [options.limit] The maximum number of items to place in the array. | ||
*/ | ||
toArray(options?: { | ||
limit?: number; | ||
}): Promise<T[]>; | ||
} | ||
@@ -517,3 +530,3 @@ /** | ||
protected _source?: InternalSource<S>; | ||
protected _createSource?: (() => AsyncIteratorOrPromise<S>) | null; | ||
protected _createSource?: (() => MaybePromise<AsyncIterator<S>>) | null; | ||
protected _destroySource: boolean; | ||
@@ -663,5 +676,5 @@ protected _optional: boolean; | ||
*/ | ||
constructor(sources: AsyncIteratorOrArray<AsyncIterator<T>>, options?: BufferedIteratorOptions); | ||
constructor(sources: AsyncIteratorOrArray<AsyncIterator<T>> | AsyncIteratorOrArray<Promise<AsyncIterator<T>>> | AsyncIteratorOrArray<MaybePromise<AsyncIterator<T>>>, options?: BufferedIteratorOptions); | ||
protected _loadSources(): void; | ||
protected _addSource(source: InternalSource<T>): void; | ||
protected _addSource(source: MaybePromise<InternalSource<T>>): void; | ||
protected _removeEmptySources(): void; | ||
@@ -729,3 +742,3 @@ protected _read(count: number, done: () => void): void; | ||
*/ | ||
export declare function union<T>(sources: AsyncIteratorOrArray<AsyncIterator<T>>): UnionIterator<T>; | ||
export declare function union<T>(sources: AsyncIteratorOrArray<AsyncIterator<T>> | AsyncIteratorOrArray<Promise<AsyncIterator<T>>> | AsyncIteratorOrArray<MaybePromise<AsyncIterator<T>>>): UnionIterator<T>; | ||
/** | ||
@@ -757,5 +770,5 @@ Creates an iterator of integers for the given numeric range. | ||
} | ||
declare type MaybePromise<T> = T | Promise<T>; | ||
declare type AsyncIteratorOrArray<T> = T[] | AsyncIterator<T>; | ||
declare type AsyncIteratorOrPromise<T> = AsyncIterator<T> | Promise<AsyncIterator<T>>; | ||
declare type SourceExpression<T> = AsyncIteratorOrPromise<T> | (() => AsyncIteratorOrPromise<T>); | ||
declare type SourceExpression<T> = MaybePromise<AsyncIterator<T>> | (() => MaybePromise<AsyncIterator<T>>); | ||
declare type InternalSource<T> = AsyncIterator<T> & { | ||
@@ -762,0 +775,0 @@ _destination: AsyncIterator<any>; |
{ | ||
"name": "asynciterator", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "An asynchronous iterator library for advanced object pipelines.", | ||
@@ -25,5 +25,5 @@ "author": "Ruben Verborgh <ruben@verborgh.org>", | ||
"build:module": " tsc --module es2015 && mv dist/ts-out/*.js dist && npm run build:module:import", | ||
"build:module:import": " sed -i'.bak' -e 's/\\.\\/taskscheduler/.\\/taskscheduler.js/' dist/asynciterator.js && rm dist/*.bak", | ||
"build:module:import": " sed -i'.bak' -e 's/\\.\\/linkedlist/.\\/linkedlist.js/' -e 's/\\.\\/taskscheduler/.\\/taskscheduler.js/' dist/asynciterator.js && rm dist/*.bak", | ||
"build:commonjs": "tsc --module commonjs && ./.change-extension cjs dist/ts-out/*.js && mv dist/ts-out/*.cjs dist && npm run build:commonjs:import", | ||
"build:commonjs:import": "sed -i'.bak' -e 's/\\.\\/taskscheduler/.\\/taskscheduler.cjs/' dist/asynciterator.cjs && rm dist/*.bak", | ||
"build:commonjs:import": "sed -i'.bak' -e 's/\\.\\/linkedlist/.\\/linkedlist.cjs/' -e 's/\\.\\/taskscheduler/.\\/taskscheduler.cjs/' dist/asynciterator.cjs && rm dist/*.bak", | ||
"build:types": "tsc -d && rm dist/ts-out/*.js && mv dist/ts-out/*.d.ts dist", | ||
@@ -30,0 +30,0 @@ "prepare": "npm run build", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188702
14
4351