stack-base-iterator
Advanced tools
+2
-2
| { | ||
| "name": "stack-base-iterator", | ||
| "version": "2.1.5", | ||
| "version": "2.1.6", | ||
| "description": "Base iterator for values retrieved using a stack of async functions returning values", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
| "main": "dist/cjs/index.js", | ||
| "types": "dist/cjs/index.d.cts", | ||
| "types": "dist/cjs/index.d.ts", | ||
| "files": [ | ||
@@ -31,0 +31,0 @@ "dist" |
| import LinkedList from './LinkedList.js'; | ||
| import type { EachDoneCallback, EachFunction, ForEachOptions, ProcessCallback, Processor, StackOptions, ValueCallback } from './types.js'; | ||
| export type StackFunction<T, TReturn = unknown, TNext = unknown> = (iterator: StackBaseIterator<T, TReturn, TNext>, callback: ValueCallback<T>) => void; | ||
| declare const Symbol: SymbolConstructor; | ||
| export { default as LinkedList } from './LinkedList.js'; | ||
| export type * from './types.js'; | ||
| export default class StackBaseIterator<T, TReturn = unknown, TNext = unknown> implements AsyncIterableIterator<T, TReturn, TNext> { | ||
| protected done: boolean; | ||
| protected stack: StackFunction<T, TReturn, TNext>[]; | ||
| protected queued: ProcessCallback<T>[]; | ||
| protected processors: LinkedList<Processor>; | ||
| protected processing: LinkedList<ProcessCallback<T>>; | ||
| protected options: StackOptions; | ||
| protected destroyed: boolean; | ||
| constructor(options?: StackOptions); | ||
| isDone(): boolean; | ||
| push(fn: StackFunction<T, TReturn, TNext>, ...rest: StackFunction<T, TReturn, TNext>[]): void; | ||
| next(): Promise<IteratorResult<T, TReturn>>; | ||
| [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>; | ||
| forEach(fn: EachFunction<T>, options?: ForEachOptions | EachDoneCallback, callback?: EachDoneCallback): undefined | Promise<boolean>; | ||
| end(err?: Error): void; | ||
| destroy(err?: Error): void; | ||
| private _pump; | ||
| private _processOrQueue; | ||
| } |
| export default class LinkedList<T> { | ||
| private head; | ||
| private tail; | ||
| length: number; | ||
| constructor(); | ||
| last(): T; | ||
| push(value: T): LinkedList<T>; | ||
| pop(): T; | ||
| remove(value: T): T; | ||
| } |
| export type { EachDoneCallback, EachFunction, ForEachOptions, NextCallback, ProcessCallback, Processor, ProcessorOptions } from 'maximize-iterator'; | ||
| export interface StackOptions { | ||
| error?: (err: NodeJS.ErrnoException) => boolean; | ||
| } | ||
| export type ValueCallback<T, TReturn = unknown> = (error?: Error, value?: IteratorResult<T, TReturn> | undefined) => undefined; |
59867
-3.24%23
-11.54%