UNPKG

single-source-of-truth

Version:
10 lines (8 loc) 279 B
import type { Standard } from '~/standard.js'; import type { TruthEnum } from '../schemas/enum.js'; export function parseEnumSchema(name: string, schema: TruthEnum<any>) { return { name, values: schema.values.map((v: string) => ({ name: v })), } as Standard.Enum; }