Comment

Comment by gvergnaud

It's actually not in the standard library, but you can write it yourself:

type Expect<T extends true> = T;

`T extends true` puts a type constraint on the parameter, which then needs to be assignable to the literal type `true` to type-check.

parent gvergnaud 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton