MCPcopy Create free account
hub / github.com/microsoft/TypeChat / validate

Function validate

typescript/src/zod/validate.ts:23–29  ·  view source on GitHub ↗
(jsonObject: object)

Source from the content-addressed store, hash-verified

21 return validator;
22
23 function validate(jsonObject: object) {
24 const result = schema[typeName].safeParse(jsonObject);
25 if (!result.success) {
26 return error(result.error.issues.map(({ path, message }) => `${path.map(key => `[${JSON.stringify(key)}]`).join("")}: ${message}`).join("\n"));
27 }
28 return success(result.data as z.infer<T[K]> & object);
29 }
30}
31
32// ZodTypeKind is the union of all type-discriminant strings defined by Zod v4.

Callers

nothing calls this directly

Calls 2

errorFunction · 0.90
successFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…