install-nix-action/node_modules/lodash/_mapToArray.js
Domen Kožar 70742d22d9
v6
2019-11-19 17:50:30 +01:00

18 lines
363 B
JavaScript

/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;