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.
10 lines • 395 B
TypeScript
/**
* @public
* Replaces `null` / `undefined` with an empty `Array`.
* @returns `array` if it's an `Array` of length greater than 0, otherwise an empty `Array`.
*
* @remarks
* See {@link arrayNormalizeNullishToEmpty}.
*/
export declare function arrayNormalizeNullishToEmpty<TItem>(array: TItem[] | null | undefined): TItem[];
//# sourceMappingURL=array-normalize-nullish-to-empty.d.ts.map