-
Notifications
You must be signed in to change notification settings - Fork 18
Strummer v3 proposal #191
Comments
[
{
code: '',
message: '',
originalValue: '',
parsedValue: ''
}
] this way, we still have the same structure i.e. no breaking change |
@vickvu I think even if we did your suggestion for number 1 it will still be a breaking change, at the moment the presence of a non empty array indicates there are errors, so in the case where there are no errors but there is a parsed value, it would not work, and it's not a very good api what I'm looking for is the following response { errors: [], parsedValue: 123 } I understand you wanting to keep it backwards compatible but it's been a frustrating thing for a few years now and at some point there will need to be a breaking change |
@vickvu @deancouch any more thoughts on this? it's been 6 years since a major release :) |
@nguyenchr - I'm fine with having breaking changes, so 👍 for 1) |
@deancouch @vickvu did you guys have any more thoughts ^^ |
Any further thoughts on this or is strummer no longer maintained or intending a new version? |
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: [] }
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 strummers.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 matchers.partial
matcher for that purpose, it is more explicit this ways.object
(ands.partial
when it's introduced)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 }
s.object({ optional: true, schema: { foo: s.string(), bar: s.number() } })
The text was updated successfully, but these errors were encountered: