How to use the pairs function from lodash
Find comprehensive JavaScript lodash.pairs code examples handpicked from public code repositorys.
3607 3608 3609 3610 3611 3612 3613 3614 3615 3616
* @category Objects * @param {Object} object The object to inspect. * @returns {Array} Returns new array of key-value pairs. * @example * * _.pairs({ 'barney': 36, 'fred': 40 }); * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) */ function pairs(object) { var index = -1,
73
711
29
GitHub: compdemocracy/polis
163 164 165 166 167 168 169 170 171 172 173
const params = new URLSearchParams(queryString); return Object.fromEntries(params); } function toQueryParamString(o) { var pairs = _.pairs(o); pairs = _.map(pairs, function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]); }); return pairs.join("&");
125
491
21
+ 4 other calls in file
GitHub: chevdor/dapple
100 101 102 103 104 105 106 107 108 109
// been lower than the depth of the package including it. var depths = {}; if (SOURCEMAP_KEY in sources) { sources[SOURCEMAP_KEY] = JSON.parse(sources[SOURCEMAP_KEY]); for (let pair of _.pairs(sources[SOURCEMAP_KEY])) { let hashPath = pair[0]; let paths = pair[1]; depths[hashPath] = _.min(_.map(
65
1
3
+ 5 other calls in file
lodash.get is the most popular function in lodash (7670 examples)