Skip to main content
Module

std/testing/types.ts>AssertTrue

The Deno Standard Library
Latest
type alias AssertTrue
import { type AssertTrue } from "https://deno.land/std@0.222.1/testing/types.ts";

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

Examples

Example 1

import { AssertTrue, Has, IsNullable } from "https://deno.land/std@0.222.1/testing/types.ts";

const result = 1 as string | number | null;

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

Type Parameters

T extends true
definition: never