xdesign-vue-next
Version:
XDesign Component for vue-next
174 lines (160 loc) • 4.53 kB
JavaScript
/**
* xdesign v1.0.6
* (c) 2023 xdesign
* @license MIT
*/
import './dep-10a947a6.mjs';
import { b as _baseGet, c as _castPath, a as _toKey } from './dep-fa6608fd.mjs';
import { _ as _baseSet } from './dep-cc9bfda3.mjs';
import { i as isArguments_1 } from './dep-dafada74.mjs';
import { i as isArray_1 } from './dep-a95026f2.mjs';
import './dep-068e912d.mjs';
import { _ as _isIndex } from './dep-71f84cf2.mjs';
import { i as isLength_1 } from './dep-e1ab85c5.mjs';
import { _ as _flatRest } from './dep-b57a2815.mjs';
var baseGet = _baseGet,
baseSet = _baseSet,
castPath$1 = _castPath;
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy$1(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath$1(path, object), value);
}
}
return result;
}
var _basePickBy = basePickBy$1;
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn$1(object, key) {
return object != null && key in Object(object);
}
var _baseHasIn = baseHasIn$1;
var castPath = _castPath,
isArguments = isArguments_1,
isArray = isArray_1,
isIndex = _isIndex,
isLength = isLength_1,
toKey = _toKey;
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath$1(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
var _hasPath = hasPath$1;
var baseHasIn = _baseHasIn,
hasPath = _hasPath;
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn$1(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
var hasIn_1 = hasIn$1;
var basePickBy = _basePickBy,
hasIn = hasIn_1;
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick$1(object, paths) {
return basePickBy(object, paths, function (value, path) {
return hasIn(object, path);
});
}
var _basePick = basePick$1;
var basePick = _basePick,
flatRest = _flatRest;
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function (object, paths) {
return object == null ? {} : basePick(object, paths);
});
var pick_1 = pick;
export { hasIn_1 as h, pick_1 as p };
//# sourceMappingURL=dep-abf7f90d.mjs.map