Files
lodash/zipObjectDeep.js
John-David Dalton 466c67a8b6 Bump to v4.1.0.
2016-01-29 01:20:57 -08:00

23 lines
613 B
JavaScript

import baseSet from './_baseSet';
import baseZipObject from './_baseZipObject';
/**
* This method is like `_.zipObject` except that it supports property paths.
*
* @static
* @memberOf _
* @category Array
* @param {Array} [props=[]] The property names.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
*/
function zipObjectDeep(props, values) {
return baseZipObject(props || [], values || [], baseSet);
}
export default zipObjectDeep;