UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

58 lines (28 loc) 1.01 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [rc-js-util](./rc-js-util.md) &gt; [arrayNormalizeEmptyToUndefined](./rc-js-util.arraynormalizeemptytoundefined.md) ## arrayNormalizeEmptyToUndefined() function Replaces length 0 `ArrayLike` with `undefined`<!-- -->. **Signature:** ```typescript export declare function arrayNormalizeEmptyToUndefined<TArray extends ArrayLike<unknown>>(array: TArray | null | undefined): TArray | undefined; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> array </td><td> TArray \| null \| undefined </td><td> </td></tr> </tbody></table> **Returns:** TArray \| undefined `array` if it's an `ArrayLike` of length greater than 0, otherwise `undefined`<!-- -->. ## Remarks See [arrayNormalizeEmptyToUndefined()](./rc-js-util.arraynormalizeemptytoundefined.md)<!-- -->.