Sha256: 3e7142e5eb398729f0c68e3577cd0f83785b24a5ed832d9f431aca9417a44a51
Contents?: true
Size: 405 Bytes
Versions: 26
Compression:
Stored size: 405 Bytes
Contents
/** * convert an object into its 2D array equivalent to be turned * into an ES6 map * * @param {object} obj any object type that works with Object.keys() * @returns {Map<TODO, TODO>} an ES6 Map of KV pairs */ module.exports = function objectToMap(obj) { return new Map( Object.keys(obj).map(key => { /** @type {[string, string]} */ const pair = [key, obj[key]]; return pair; }) ); };
Version data entries
26 entries across 25 versions & 8 rubygems