main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
343 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | "use strict";
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * Convert an object into an ES6 map
|
---|
| 9 | * @param {object} obj any object type that works with Object.entries()
|
---|
| 10 | * @returns {Map<string, any>} an ES6 Map of KV pairs
|
---|
| 11 | */
|
---|
| 12 | module.exports = function objectToMap(obj) {
|
---|
| 13 | return new Map(Object.entries(obj));
|
---|
| 14 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.