UNPKG

tdesign-vue-next

Version:
77 lines (70 loc) 1.98 kB
/** * tdesign v1.19.2 * (c) 2026 tdesign * @license MIT */ 'use strict'; var _baseGet = require('./dep-4eca9add.js'); var _baseSet = require('./dep-690970a4.js'); var hasIn = require('./dep-42740075.js'); var _flatRest = require('./dep-7870f4cb.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.basePickBy = basePickBy; exports.pick = pick$1; //# sourceMappingURL=dep-eb3114d9.js.map