MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / isConfigValueValid

Function isConfigValueValid

frontend/src/ts/config/validation.ts:27–36  ·  view source on GitHub ↗
(
  key: string,
  val: T,
  schema: ZodSchema<T>,
)

Source from the content-addressed store, hash-verified

25}
26
27export function isConfigValueValid<T>(
28 key: string,
29 val: T,
30 schema: ZodSchema<T>,
31): boolean {
32 const isValid = schema.safeParse(val).success;
33 if (!isValid) invalid(key, val, undefined);
34
35 return isValid;
36}
37
38export function isConfigValueValidBoolean(key: string, val: boolean): boolean {
39 return isConfigValueValid(key, val, z.boolean());

Callers 3

setConfigFunction · 0.90
toggleFunboxFunction · 0.90

Calls 1

invalidFunction · 0.85

Tested by

no test coverage detected