Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


Deno module to generate images from source code using Aloxaf/silicon.
function assert
import { assert } from "";

Asserts that the given value satisfies the provided predicate.

import { assert } from "./util.ts";
import is from "./is.ts";

const a: unknown = "hello";
assert(a, is.String);
// a is now narrowed to string


x: unknown

The value to be asserted.

pred: Predicate<T>

The predicate function to test the value against.

options: { message?: string; name?: string; } = [UNSUPPORTED]

Optional configuration for the assertion.


asserts x is T

Nothing. The function has a return type of asserts x is T to help TypeScript narrow down the type of x after the assertion.