Skip to content

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.

T extends object

MaybeAsyncIterable<T | null | undefined>

The input iterable, sync or async.

AsyncIterableIterator<T>

An iterator yielding only non-null and non-undefined values.