Home > rc-js-util > arrayNormalizeEmptyToUndefined
Replaces length 0 ArrayLike
with undefined
.
Signature:
export declare function arrayNormalizeEmptyToUndefined<TArray extends ArrayLike<unknown>>(array: TArray | null | undefined): TArray | undefined;
Parameter | Type | Description |
---|---|---|
array | TArray | null | undefined |
Returns:
TArray | undefined
array
if it’s an ArrayLike
of length greater than 0, otherwise undefined
.