{"repo":"didier/formshape","free":true,"listed":false,"github":"https://github.com/didier/formshape","clone":"git clone https://github.com/didier/formshape.git","description":"Type-safe form validation for SvelteKit Remote Functions using Standard Schema compatible validators.","language":"TypeScript","stars":11,"topics":["forms","remote-functions","standard-schema","svelte","sveltekit","valibot","zod","sveltekit-remote-functions"],"license":null,"category":"machine-learning","readme_excerpt":"formshape Type-safe form validation for SvelteKit Remote Functions using Standard Schema compatible validators. Features - 🎯 Works with any Standard Schema compatible library (Zod, Valibot, Arktype, etc.) - 🔒 Full type safety with automatic type inference - ⚡ Preserves all SvelteKit form features (progressive enhancement, enhance , buttonProps , etc.) - 📦 Lightweight with zero dependencies (besides your validator) - 🎭 Same API as SvelteKit's form function Installation Usage 1. Create a validated function in your server code 2. Use it in your Svelte component How it works The createValidated function takes your app's form function and returns a validated function. This approach ensures that the package works correctly when installed from npm, as it uses your app's SvelteKit context rather than trying to import from $app/server directly. When validation fails, the function returns: When validation succeeds, your handler is called with the validated data and its return value is passed through. Using with enhance The validated form maintains full compatibility with SvelteKit's enhance : Using with other validators Any Standard Schema compatible validator works: Valibot Arktype API createValidated(form) Creates a validated function using your app's form function. - Parameters: - form : The form function from $app/server - Returns: A validated function validated(schema, handler) Creates a form handler with validation. - Parameters: - schema : A Standard Schema compatible valida","default_branch":null,"files":null,"tree":[],"storefront":"/r/didier","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/didier/formshape/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}