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
improvement: change validate from an assertion function to a type guard (#13)
Usage of parser.validate is unclear because you need to assign an output type, which defeats the
purpose of this whole library (see microsoft/TypeScript#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.
0 commit comments