You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. /**
  2. * Converts `map` to its key-value pairs.
  3. *
  4. * @private
  5. * @param {Object} map The map to convert.
  6. * @returns {Array} Returns the key-value pairs.
  7. */
  8. function mapToArray(map) {
  9. var index = -1,
  10. result = Array(map.size);
  11. map.forEach(function(value, key) {
  12. result[++index] = [key, value];
  13. });
  14. return result;
  15. }
  16. module.exports = mapToArray;