@kellanjs/actioncraft
Version:
Fluent, type-safe builder for Next.js server actions.
16 lines • 687 B
JavaScript
// ============================================================================
// RUNTIME HELPERS
// ============================================================================
/** Helper function to validate input using a Standard Schema. */
export async function standardParse(schema, value) {
return schema["~standard"].validate(value);
}
/** Type guard to check if a value is a Standard Schema. */
export function isStandardSchema(value) {
return (typeof value === "object" &&
value !== null &&
"~standard" in value &&
typeof value["~standard"] === "object" &&
value["~standard"].version === 1);
}
//# sourceMappingURL=standard-schema.js.map