UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

18 lines (17 loc) 635 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const isArrayLikeObject_1 = __importDefault(require("../isArrayLikeObject")); /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return (0, isArrayLikeObject_1.default)(value) ? value : []; } exports.default = castArrayLikeObject;