You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that bar should be considered optional, since we omitted the isRequired call. However, validator warnings will still be thrown if a value is not passed.
It seems like we may want something like Config.number() to be implicitly Config.maybe(Config.number()).
Any thoughts on this would be greatly appreciated, thanks!
The text was updated successfully, but these errors were encountered:
That makes sense, if a value is not listed as required than it should behave as optional, otherwise it'll be very confusing. Your suggestion of having validators work as maybe by default is a good one. In this case we may actually not need to expose Config.maybe at all then, since that's always implied.
Now, to stop accepting those the "required" config should be used instead (via the `Config` module).
Also, the `shapeOf` validator can receive config objects, for specifying not only the validator but also if it should be required or not. If this information isn't given, any property in the defined shape will be assumed to be optional.
Given the following configuration:
It seems that
bar
should be considered optional, since we omitted theisRequired
call. However, validator warnings will still be thrown if a value is not passed.It seems like we may want something like
Config.number()
to be implicitlyConfig.maybe(Config.number())
.Any thoughts on this would be greatly appreciated, thanks!
The text was updated successfully, but these errors were encountered: