_setToPairs.js 364 B

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