Functions
asIterator
- asIterator<T>(elements: readonly T[]): IterableIterator<T>
Type Parameters
Parameters
Returns IterableIterator<T>
breadthFirst
- breadthFirst<T>(root: T, children: ((node: T) => undefined | T[]), include?: ((node: T) => boolean)): IterableIterator<T>
Type Parameters
Parameters
root: T
children: ((node: T) => undefined | T[])
- (node: T): undefined | T[]
Parameters
Returns undefined | T[]
include: ((node: T) => boolean) = ...
Parameters
Returns boolean
Returns IterableIterator<T>
cycle
- cycle<T>(elements: readonly T[], start?: T): IterableIterator<T>
Type Parameters
Parameters
elements: readonly T[]
Optional start: T
Returns IterableIterator<T>
depthFirst
- depthFirst<T>(root: T, children: ((node: T) => undefined | T[]), include?: ((node: T) => boolean)): IterableIterator<T>
Type Parameters
Parameters
root: T
children: ((node: T) => undefined | T[])
- (node: T): undefined | T[]
Parameters
Returns undefined | T[]
include: ((node: T) => boolean) = ...
Parameters
Returns boolean
Returns IterableIterator<T>
Returns with the iterator of the argument.