News for hackers. Stuff that matters.
Re:Show HN: A SQL database implemented purely in TypeScript ... by vorticalbox on Monday September 28, 2020 @11:12AM (#24617489)
I was thinking about this the other day i would love for TS flag that would turn an interface into an assert

const shout = (message: string) => console.log(message)

into something like

const assert = require('assert'); const shout = (message) => { assert(typeof message === "string"); console.log(message); }

of course this doesn't work for more complicated types

Re:Show HN: A SQL database implemented purely in TypeScript ... by IggleSniggle on Monday September 28, 2020 @12:38PM (#24618497)
You should checkout myzod, which is very close to this experience.
Re:Show HN: A SQL database implemented purely in TypeScript ... by vorticalbox on Friday October 02, 2020 @03:05AM (#24659815)
Thanks for this
Re:Show HN: A SQL database implemented purely in TypeScript ... by colinmcd on Monday September 28, 2020 @06:01PM (#24621690)
Or just plain zod
Re:Show HN: A SQL database implemented purely in TypeScript ... by IggleSniggle on Wednesday September 30, 2020 @12:22AM (#24635675)
Genuinely curious, why would you pick zod over myzod?