Closed Raynos closed 9 years ago
I have a thing called Enum in my validation library ( https://github.com/Colingo/valid-schema#enum )
Enum
Where you say
// type Foo := { foo: Enum("one", "two", "three") }
and it allows you to say that a certain key is a value from a list.
Example depends on my := extension and my type name := x => name : x and name := x => name x conventions
:=
type name := x
name : x
name := x
name x
This can be done as { foo: "one" | "two" | "three" }
{ foo: "one" | "two" | "three" }
Using type unions instead of an Enum primitive is fine.
I have a thing called
Enum
in my validation library ( https://github.com/Colingo/valid-schema#enum )Where you say
and it allows you to say that a certain key is a value from a list.
Example depends on my
:=
extension and mytype name := x
=>name : x
andname := x
=>name x
conventions