You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
267 B
JavaScript
11 lines
267 B
JavaScript
2 years ago
|
"use strict";
|
||
|
|
||
|
// Like Object.fromEntries, but for {key,value} instead of [key,value]
|
||
|
|
||
|
module.exports = function fromNamedEntries(namedEntries) {
|
||
|
return Object.fromEntries(namedEntries.map((entry) => {
|
||
|
let { key, value } = entry;
|
||
|
return [ key, value ];
|
||
|
}));
|
||
|
};
|