deno.land / x / lodash@4.17.19 / npm-package / fromPairs.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result;}
module.exports = fromPairs;
lodash

Version Info

Tagged at
3 years ago

External Dependencies

No external dependencies 🎉