-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Has PRarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
TypeScript 3.7 will support an asserts Identifier is Type syntax in function annotation positions (much like with type predicates).
declare function assertIsFoo(x): asserts x is Foo;
function assertIsDefined<T>(x: T): asserts x is NonNullable<T> {
if (x == null) throw "oh no";
}See more at the original pull request: microsoft/TypeScript#32695
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue