compactAsync
compactAsync<
T>(iterable):AsyncIterableIterator<T>
Defined in: packages/core/src/iterable/async/compact.ts:13
Removes null and undefined values from an iterable.
The async counterpart of compact.
Time complexity: O(1) per element.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”iterable
Section titled “iterable”MaybeAsyncIterable<T | null | undefined>
The input iterable, sync or async.
Returns
Section titled “Returns”AsyncIterableIterator<T>
An iterator yielding only non-null and non-undefined values.