feat: discriminatedUnion and reworked oneOf errors - #58
Merged
Conversation
…e parse() / decodePromise() error message, instead of the old dot-flattening (items.0 -> items[0]).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #58 +/- ##
==========================================
+ Coverage 98.65% 99.05% +0.40%
==========================================
Files 25 26 +1
Lines 297 317 +20
Branches 88 93 +5
==========================================
+ Hits 293 314 +21
+ Misses 4 3 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
discriminatedUniondecoder for tagged unions - validates only the matching variant and reports a precise error on unknown tags, avoiding the noise ofoneOftrying every branch.oneOffailure output: replace the old "deepest path wins" heuristic with ano alternative matched (tried N)summary followed by every branch's failure; same-path issues collapse intoX or Ymessages.formatIssuePathhelper and use it inparse()/decodePromise()so array indices render with bracket notation (items[0]instead ofitems.0).JSON.stringifyconsistently with other primitive decoders.