|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
369 bytes
|
| Line | |
|---|
| 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 | * @template {object} T
|
|---|
| 10 | * @param {T} obj any object type that works with Object.entries()
|
|---|
| 11 | * @returns {Map<string, T[keyof T]>} an ES6 Map of KV pairs
|
|---|
| 12 | */
|
|---|
| 13 | module.exports = function objectToMap(obj) {
|
|---|
| 14 | return new Map(Object.entries(obj));
|
|---|
| 15 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.