Skip to content

typescript assertion functions #2622

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

Closed
ghost opened this issue Dec 11, 2020 · 2 comments
Closed

typescript assertion functions #2622

ghost opened this issue Dec 11, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 11, 2020

Typescript since 3.7 has a way to declare that a function is an assertion function, which lets it make inferences about null/undefined values.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions

Is this something ava should support? I can make a PR for it. (It would be conditional on typescript version)

@ghost ghost added the question label Dec 11, 2020
@sindresorhus
Copy link
Member

Relevant issue: #2449

@novemberborn
Copy link
Member

I don't believe this works with our assertions, being members of our t object.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants