tdesign-vue
Version:
76 lines (69 loc) • 1.95 kB
JavaScript
/**
* tdesign v1.11.2
* (c) 2025 tdesign
* @license MIT
*/
;
var _baseGet = require('./dep-362bc4d7.js');
var _baseSet = require('./dep-73fb598e.js');
var hasIn = require('./dep-2e32c1f2.js');
var _flatRest = require('./dep-a9e7deb2.js');
/**
* 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(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = _baseGet.baseGet(object, path);
if (predicate(value, path)) {
_baseSet.baseSet(result, _baseGet.castPath(path, object), value);
}
}
return result;
}
/**
* 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(object, paths) {
return basePickBy(object, paths, function (value, path) {
return hasIn.hasIn(object, path);
});
}
/**
* 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.flatRest(function (object, paths) {
return object == null ? {} : basePick(object, paths);
});
var pick$1 = pick;
exports.pick = pick$1;
//# sourceMappingURL=dep-71fa6788.js.map