Closed gcanti closed 8 years ago
age and weight must be numbers or.. both null
I think you meant street
and city
? ;) In practice, I can see myself using this. So why not?
opss...thanks @volkanunsal, fixed
I 100% agree. This is exactly what I would expect
About lists, perhaps it's better:
a maybe list is null if and only if its length === 0
Released in v0.6.10 and v0.7.6
Let's say you have this type:
everything's ok, all fields are required. Now consider this type:
what does
t.maybe(t.struct({...
means? A natural answer would be:name
is requiredstreet
andcity
must be strings or.. bothnull
(EDIT)So can we infer the following rules?
I'd love to hear your opinion on this
/cc @VinSpee