MCPcopy Create free account
hub / github.com/dailydotdev/apps / toIndexedObject

Function toIndexedObject

packages/shared/src/lib/lifecycle.ts:16–20  ·  view source on GitHub ↗
(arr: string[])

Source from the content-addressed store, hash-verified

14 * @return {!Object}
15 */
16const toIndexedObject = (arr: string[]): Record<string, number> =>
17 arr.reduce<Record<string, number>>((acc, val, idx) => {
18 acc[val] = idx;
19 return acc;
20 }, {});
21
22/**
23 * @type {!Array<!Object>}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected