Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/_util/asserts.ts

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.166.0/_util/asserts.ts";

Classes

All internal non-test code, that is files that do not have test or bench in the name, must use the assertion functions within _utils/asserts.ts and not testing/asserts.ts. This is to create a separation of concerns between internal and testing assertions.

Functions

Make an assertion, if not true, then throw.

Use this to assert unreachable code.