MCPcopy Create free account
hub / github.com/Make-md/makemd / arrayToObject

Function arrayToObject

src/core/utils/objects.ts:46–46  ·  view source on GitHub ↗
(array: {[key: string]: any}[], key: string)

Source from the content-addressed store, hash-verified

44}
45
46export const arrayToObject = (array: {[key: string]: any}[], key: string) => array.reduce((p,c) => ({...p, [c[key]]: c}) , {})
47
48export const renameKey = (object: {[key: string]: any}, oldKey: string, newKey: string) => {
49 if (!object) return;

Callers

nothing calls this directly

Calls 1

reduceMethod · 0.80

Tested by

no test coverage detected