JS Type Checker Wish List: Regex validated strings
type HexColor = /#[0-9a-f]+/i;
const color: HexColor = '#eee'; // fine
const color: HexColor = 'red'; // error!
I don't want runtime validation of the types, and the CIJ library needs all style values to be static.
-
-
Yeah. It can still all be static. (I know which library you’re talking about) color: rgb(100, 200, 100); The rgb function can just be a stub for types and be compiled away at build time.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 