Skip to main content

@std/testing@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score52%
Published2 years ago (0.215.0)

Functions

f
assertType<T extends true | false>(_expectTrue: T): void

Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.

Type Aliases

T
Assert<T extends true | false, Expected extends T> = never

Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.

T
AssertFalse<T extends false> = never

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

T
AssertTrue<T extends true> = never

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

T
Has<T, U> = IsAny<T> extends true ? true : IsAny<U> extends true ? false : Extract<T, U> extends never ? false : true

Checks if type T has the specified type U.

T
IsAny<T> = 0 extends (1 & T) ? true : false

Checks if type T is the any type.

T
IsExact<T, U> = TupleMatches<AnyToBrand<T>, AnyToBrand<U>> extends true ? TupleMatches<DeepPrepareIsExact<T>, DeepPrepareIsExact<U>> extends true ? true : false : false

Checks if type T exactly matches type U.

T
IsNever<T> = [T] extends [never] ? true : false

Checks if type T is the never type.

T
IsNullable<T> = Extract<T, null | undefined> extends never ? false : true

Checks if type T is possibly null or undefined.

T
IsUnknown<T> = unknown extends T ? ([T] extends [null] ? false : true) : false

Checks if type T is the unknown type.

T
NotHas<T, U> = Has<T, U> extends false ? true : false

Checks if type T does not have the specified type U.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/testing

Import symbol

import * as mod from "@std/testing/types";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/testing/types";