Hacker News new | ask | show | jobs
by xsmasher 1424 days ago
That did not compile for me with my TS settings;

> Type '{ dev: boolean; readonly prod: void; }' is not assignable to type '{ prod: true; }'

It's still a bad solution though; it allows nonsense values like {dev:true, prod:true}.

1 comments

That is because I forgot to assert the true as literal true, so it defaults to be boolean (where both true and false are allowed)