UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

92 lines (84 loc) 2.4 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import './dep-10a947a6.mjs'; import { _ as _baseKeys, a as _getTag } from './dep-69963a8c.mjs'; import { i as isArguments_1 } from './dep-dafada74.mjs'; import { i as isArray_1 } from './dep-a95026f2.mjs'; import './dep-068e912d.mjs'; import { i as isArrayLike_1 } from './dep-0e832fc7.mjs'; import { i as isBuffer$1, _ as _isPrototype, a as isTypedArray_1 } from './dep-6e7b37b8.mjs'; var baseKeys = _baseKeys, getTag = _getTag, isArguments = isArguments_1, isArray = isArray_1, isArrayLike = isArrayLike_1, isBuffer = isBuffer$1.exports, isPrototype = _isPrototype, isTypedArray = isTypedArray_1; /** `Object#toString` result references. */ var mapTag = '[object Map]', setTag = '[object Set]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } var isEmpty_1 = isEmpty; export { isEmpty_1 as i }; //# sourceMappingURL=dep-9d7ebc32.mjs.map