UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

16 lines 395 B
/** * @public * Like `Array.map` but with a `Map` input. Outputs an `Array`. * * @returns An array of mapped values. * * @remarks * See {@link mapArrayMap}. */ export function mapArrayMap(map, callback) { const mapped = new Array(map.size); let index = 0; map.forEach((v, k) => mapped[index++] = callback(v, k)); return mapped; } //# sourceMappingURL=map-array-map.js.map