Is there a reason why Arg.is<MyType> is any inside the callback? It feels like we are missing a hand from typescript here - it can verify strongly typed arguments and give a compile-time error. With any argument type typescript is useless and we won't receive a compile-time error, for example on misspelled property.
Here is how type definition looks like right now:
static is<T>(predicate: (input: any) => boolean): Argument<T> & T;
and here is how it "should" look like (possibly):
static is<T>(predicate: (input: T) => boolean): Argument<T> & T;
Is there a reason why
Arg.is<MyType>isanyinside the callback? It feels like we are missing a hand from typescript here - it can verify strongly typed arguments and give a compile-time error. Withanyargument type typescript is useless and we won't receive a compile-time error, for example on misspelled property.Here is how type definition looks like right now:
and here is how it "should" look like (possibly):