MCPcopy Create free account
hub / github.com/celerforge/freenote / objEnum

Function objEnum

src/lib/utils.ts:8–14  ·  view source on GitHub ↗
(enumValues: readonly T[])

Source from the content-addressed store, hash-verified

6}
7
8export function objEnum<T extends string>(enumValues: readonly T[]) {
9 const enumObject = {} as { [K in T]: K };
10 for (const enumValue of enumValues) {
11 enumObject[enumValue] = enumValue;
12 }
13 return enumObject;
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected