CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
fromPairs.js31 linesDownload Raw Back to lodash-es
1import baseAssignValue from './_baseAssignValue.js';2 3/**4 * The inverse of `_.toPairs`; this method returns an object composed5 * from key-value `pairs`.6 *7 * @static8 * @memberOf _9 * @since 4.0.010 * @category Array11 * @param {Array} pairs The key-value pairs.12 * @returns {Object} Returns the new object.13 * @example14 *15 * _.fromPairs([['a', 1], ['b', 2]]);16 * // => { 'a': 1, 'b': 2 }17 */18function fromPairs(pairs) {19  var index = -1,20      length = pairs == null ? 0 : pairs.length,21      result = {};22 23  while (++index < length) {24    var pair = pairs[index];25    baseAssignValue(result, pair[0], pair[1]);26  }27  return result;28}29 30export default fromPairs;31 
basant307/AI_Governance_Project · CoolFace