sveltekit-superforms icon indicating copy to clipboard operation
sveltekit-superforms copied to clipboard

feat: Add typia adapter

Open ryoppippi opened this issue 1 year ago • 5 comments

fixes: #440

Hi! I made an adapter for typia!!

Changes

  • Added a new adapter file src/lib/adapters/typia.ts which defines typia and typiaClient adapter creation functions. These allow using typia for server-side and client-side form validation respectively.

  • Updated src/lib/adapters/adapters.ts to include 'typia' as a supported validation library type.

  • Added new test cases in src/tests/superValidate.test.ts to test form validation using the typia adapter. The tests cover validating fields like email, strings with no whitespace, arrays with min length, etc.

  • Modified vite.config.ts to include the @ryoppippi/unplugin-typia Vite plugin.

This allows users to leverage typia with superforms

Please let me know if you have any feedback or suggestions to improve the typia integration.

ryoppippi avatar Jun 06 '24 14:06 ryoppippi