MCPcopy Create free account
hub / github.com/dunky11/react-saas-template / mapToArray

Function mapToArray

src/shared/functions/toArray.js:242–251  ·  view source on GitHub ↗

* Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs.

(map)

Source from the content-addressed store, hash-verified

240 * @returns {Array} Returns the key-value pairs.
241 */
242function mapToArray(map) {
243 let index = -1;
244
245 const result = Array(map.size);
246
247 map.forEach((value, key) => {
248 result[++index] = [key, value];
249 });
250 return result;
251}
252
253/**
254 * Creates a unary function that invokes `func` with its argument transformed.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected