time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

zipObjectDeep.js (643B)


      1 var baseSet = require('./_baseSet'),
      2     baseZipObject = require('./_baseZipObject');
      3 
      4 /**
      5  * This method is like `_.zipObject` except that it supports property paths.
      6  *
      7  * @static
      8  * @memberOf _
      9  * @since 4.1.0
     10  * @category Array
     11  * @param {Array} [props=[]] The property identifiers.
     12  * @param {Array} [values=[]] The property values.
     13  * @returns {Object} Returns the new object.
     14  * @example
     15  *
     16  * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
     17  * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
     18  */
     19 function zipObjectDeep(props, values) {
     20   return baseZipObject(props || [], values || [], baseSet);
     21 }
     22 
     23 module.exports = zipObjectDeep;