UNPKG

@jay-js/system

Version:

A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.

16 lines 647 B
import { standardSchemaResolver } from "./standard-schema-resolver.js"; import { yupResolver } from "./yup-resolver.js"; import { zodResolver } from "./zod-resolver.js"; export function resolver(schema) { if (schema["~standard"]) { return standardSchemaResolver(schema); } if (schema._def && typeof schema.parseAsync === "function") { return zodResolver(schema); } if (typeof schema.validate === "function") { return yupResolver(schema); } throw new Error("Unsupported schema type. Please use Zod, Yup, or a Standard Schema compatible library."); } //# sourceMappingURL=universal-resolver.js.map