AssertTrue

import { AssertTrue } from "jsr:@ende/testing/types";

type alias

type AssertTrue<T extends true> = never

Asserts at compile time that the provided type argument's type resolves to true.

Example: Usage

import { AssertTrue, Has, IsNullable } from "@ende/testing/types";

const result = 1 as string | number | null;

type doTest = AssertTrue<Has<typeof result, string> | IsNullable<typeof result>>;

Source