Closed ostrowr closed 5 years ago
Merging #13 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #13 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 21 24 +3
Branches 2 3 +1
=====================================
+ Hits 21 24 +3
Impacted Files | Coverage Δ | |
---|---|---|
src/tsjson-parser.ts | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update bad212a...dddc840. Read the comment docs.
Usage of parser.validate is unclear because you need to assign an output type, which defeats the purpose of this whole library (see https://github.com/microsoft/TypeScript/issues/34596 and related issues.) This changes .validate (which throws on invalid input) to .validates, which is a type guard that returns false on invalid input. .parse still throws on invalid input.
BREAKING CHANGE: TsjsonParser.validate renamed to TsjsonParser.validates and functionality changed from assertion function to type guard.
This fixes the issue in the discussion of from https://github.com/ostrowr/ts-json-validator/issues/10