padAsync
padAsync<
T,F>(iterable,length,fill):AsyncIterableIterator<T|F>
Defined in: packages/core/src/iterable/async/pad.ts:17
Yields the elements, then fill as many times as needed to reach length.
The async counterpart of pad. An input already at or beyond length passes
through unchanged — this only ever adds, never truncates.
Time complexity: O(max(n, length)).
Type Parameters
Section titled “Type Parameters”T
F
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
length
Section titled “length”number
The width to pad up to. Must be a non-negative integer.
F
The value to pad with.
Returns
Section titled “Returns”AsyncIterableIterator<T | F>
An iterator over the elements followed by the padding.
Throws
Section titled “Throws”If length is not a non-negative integer.