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.

14 lines
343 B

3 months ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. */
  4. "use strict";
  5. /**
  6. * Convert an object into an ES6 map
  7. * @param {object} obj any object type that works with Object.entries()
  8. * @returns {Map<string, any>} an ES6 Map of KV pairs
  9. */
  10. module.exports = function objectToMap(obj) {
  11. return new Map(Object.entries(obj));
  12. };