Comment

Comment by jinwoo68

As they said in README, it’s inspired by Alex King’s Parse, don’t validate [1].

Basically, rather than write a validation function, write a parser that returns a result of a specific type and use that type everywhere else. Then you can make sure the raw inputs are always validated.

[1] https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...

parent jinwoo68 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton