Skip to content
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

Make assert method an assertion function in TS #840

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andarist
Copy link

This is available since TS 3.7:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions

It could be considered a breaking change. Note that DefinitelyTyped supports officially only the last 2 years of TS releases and that makes 4.1 the last supported version there: https://github.com/DefinitelyTyped/DefinitelyTyped#support-window

@davbrito
Copy link

davbrito commented Nov 5, 2024

I think this would be a great addition to the project. Any particular reason why it's not been merged yet?

As for the breaking change, what about adding an extra method called assertType? That way, people who are currently expecting the true return can still use assert without any problem.

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

Successfully merging this pull request may close these issues.

2 participants