UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

12 lines 421 B
export const from = { isStatic: true, label: 'from', fn: function mapFrom(mapEntries, mapFn) { if (!Array.isArray(mapEntries)) { throw new TypeError(`Invalid Map entries. Each Map entry in a list [key, value]`); } const entries = 'function' === typeof (mapFn) ? mapEntries.map(mapFn) : mapEntries; return new Map(entries); }, }; //# sourceMappingURL=from.js.map