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.

19 lines 598 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.arrayNormalizeNullishToEmpty = void 0; /** * @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}. */ function arrayNormalizeNullishToEmpty(array) { if (array == null) { return []; } return array; } exports.arrayNormalizeNullishToEmpty = arrayNormalizeNullishToEmpty; //# sourceMappingURL=array-normalize-nullish-to-empty.js.map