-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matches.tuple typed as Validator<unknown, never> #473
Comments
Yes, it should be exactly the output, I have a test for this, will go about creating a fix. Thanks for finding, I think I have a unit test that will stop the regression, will work on it. it("should be able to check tuple exact shape", () => {
const input = [1, 2, 3];
const matcher = matches.tuple([
matches.number,
matches.number,
matches.number,
]);
// @ts-expect-error
const outputWrong: [number, number] = matcher.unsafeCast(input);
const outputRight: [number, number, number] = matcher.unsafeCast(input);
// expected type: Validator<unknown, [number,number,number]>
// actual type: Validator<unknown, never>;
expect(outputRight).toEqual(input);
expect(outputWrong).toEqual(input);
}); This will hit master, but there are new features so going to be a new version. What version would you also like for me to backprop this to? |
A new version is fine! This is a great library, thanks for creating it! |
Had to change the api for the creation of the tuples because of the ability to infer and tuples |
Seems like a nicer API this way anyway, thanks for the fix! |
I'm seeing this bug:
I'm seeing
Validator<unknown, never>
for all matches.tuple typesThe text was updated successfully, but these errors were encountered: