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
isValid: <T>(value: T,predicate: BasePredicate<T>)=>value is T;
Looking over the rest of the file, it seems this mistake was made in several places; ReusableValidator should probably also not use T for the value (and assert?)
The text was updated successfully, but these errors were encountered:
So, I just got to it and I have a problem: Ideally ReusableValidator<T> would also assert value is T, however typescript complains Assertions require every name in the call target to be declared with an explicit type annotation.. Do you happen to have a solution for that? I don't think it's elegant to have to explicitly them, and it's a breaking change...
Maybe one option would be not to include assert, but introduce a convenience type that extracts the type of ReusableValidator and provides another type that actually asserts. That way we don't have a breaking change but also a way for the user to easily get the assertion.
isValid
always assumes the type of the value, because the first argument should beunknown
(like it is forow
itself):ow/source/index.ts
Line 39 in 3728d91
Looking over the rest of the file, it seems this mistake was made in several places;
ReusableValidator
should probably also not useT
for the value (and assert?)The text was updated successfully, but these errors were encountered: