UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

30 lines (29 loc) 1.05 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.zipObjectDeep = void 0; const baseSet_1 = __importDefault(require("./.internal/baseSet")); const baseZipObject_1 = __importDefault(require("./.internal/baseZipObject")); /** * This method is like `zipObject` except that it supports property paths. * * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @see unzip, unzipWith, zip, zipObject, zipWith * @example * * ```js * zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]) * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } * ``` */ function zipObjectDeep(props, values) { return (0, baseZipObject_1.default)(props || [], values || [], baseSet_1.default); } exports.zipObjectDeep = zipObjectDeep; exports.default = zipObjectDeep;