UNPKG

@ws-kit/valibot

Version:

Valibot validator adapter for WS-Kit with lightweight runtime validation and minimal bundle size

24 lines 777 B
/** * Internal validation helpers and utilities. * Not part of the public API. * @internal */ import type { GenericSchema } from "valibot"; /** * Helper to extract Valibot payload schema from a message schema. * @internal */ export declare function getValibotPayload(schema: any): GenericSchema | undefined; /** * Helper to validate payload against Valibot schema. * Always uses safeParse for consistent error handling. * Coercion is controlled by schema design, not runtime flags. * Returns { success: true, data } or { success: false, error }. * @internal */ export declare function validatePayload(payload: unknown, payloadSchema: GenericSchema | undefined): { success: boolean; data?: unknown; error?: any; }; //# sourceMappingURL=internal.d.ts.map