- Preparing search index...
- The search index is not available
itr8
- itr8ToObject<TK, TV>(iterator: Iterator<[TK: string | number | symbol, TV: unknown], any, undefined> | AsyncIterator<[TK: string | number | symbol, TV: any], any, undefined>): Record<TK, TV> | Promise<Record<TK, TV>>
-
Type Parameters
-
TK extends string | number | symbol
-
TV
Parameters
-
iterator: Iterator<[TK: string | number | symbol, TV: unknown], any, undefined> | AsyncIterator<[TK: string | number | symbol, TV: any], any, undefined>
Returns Record<TK, TV> | Promise<Record<TK, TV>>
Turns an itr8 into an object. It is like Object.fromEntries, but it will work both for synchronous and asynchronous iterators
Example
Returns
an array