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
{{ message }}
This repository was archived by the owner on Dec 19, 2022. It is now read-only.
I have a few changes that I would like to introduce into strummer that will require a major release
match() will return an object { errors: [] }
currently is just returns an array of errors
by returning an object instead we can then start to return additional things for example with s.integer({ parse: true }) it would be great to return the parsedValue so we are not having to repeat the parsing in our code outside of strummer
s.object will be a strict matcher (basically what s.objectWithOnly is now)
s.object currently allow extra fields that are not defined in the schema, so essentially it is acting as a partial object matcher
by default I think it would be good to be strict, and if you just want partial matching we can introduce a new s.partial matcher for that purpose, it is more explicit this way
change the params of s.object (and s.partial when it's introduced)
right now s.object has a single argument which is the schema itself, the problem with this is that you can't pass in the standard arguments e.g. { optional: true }
something like this should be possible s.object({ optional: true, schema: { foo: s.string(), bar: s.number() } })