UNPKG

moltres-utils

Version:
40 lines (34 loc) 1.15 kB
"use strict"; require("core-js/modules/es6.object.define-property"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _isLength = _interopRequireDefault(require("./isLength")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @function * @since v0.0.3 * @category lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * isArrayLike([1, 2, 3]) // => true * * isArrayLike(document.body.children) // => true * * isArrayLike('abc') // => true * * isArrayLike(Function) // => false */ var isArrayLike = function isArrayLike(value) { return value != null && typeof value != 'function' && (0, _isLength.default)(value.length); }; var _default = isArrayLike; exports.default = _default; //# sourceMappingURL=isArrayLike.js.map