News for hackers. Stuff that matters.
Re:SvelteKit 1.0 by gmaster1440 on Wednesday December 14, 2022 @01:27PM (#33987636)
Curious how you handle `request.formData()` in Form Actions and ensuring type safety there.
Re:SvelteKit 1.0 by naasking on Wednesday December 14, 2022 @01:45PM (#33988000)
> Curious how you handle `request.formData()` in Form Actions and ensuring type safety there.

Hopefully the same way typed programming languages do it: parsing and type checking.

Re:SvelteKit 1.0 by hu3 on Wednesday December 14, 2022 @03:33PM (#33990074)
We use and recommend Zod for that:

https://github.com/colinhacks/zod#error-handling

Re:SvelteKit 1.0 by harunurhan on Wednesday December 14, 2022 @04:12PM (#33990649)
Like any user input, you do runtime type-checking and validation. TypeScript is especially great for that because it has type narrowing [0].

[0] - https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...