MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / objectToZodEnums

Function objectToZodEnums

packages/validation/src/cohort.validation.ts:7–10  ·  view source on GitHub ↗
(obj: Record<K, unknown>)

Source from the content-addressed store, hash-verified

5// imported before index.ts has finished initializing zChartEventFilter.
6// Keep in sync with zChartEventFilter in ./index.ts.
7function objectToZodEnums<K extends string>(obj: Record<K, unknown>): [K, ...K[]] {
8 const [firstKey, ...otherKeys] = Object.keys(obj) as K[];
9 return [firstKey!, ...otherKeys];
10}
11
12const zChartEventFilter = z.object({
13 id: z.string().optional().describe('Unique identifier for the filter'),

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected