Skip to main content
Module

x/enzastdlib/testing/mod.ts>assertTypeOf

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
function assertTypeOf
import { assertTypeOf } from "https://deno.land/x/enzastdlib@v0.0.4/testing/mod.ts";

Make an assertion that actual has the type of expected_type. If not then throw.

Examples

Example 1

import { assertTypeOf } from 'https://deno.land/x/enzastdlib/testing/mod.ts';

assertTypeOf('Hello World!', 'string');

Parameters

actual: unknown
expected_type: BuiltinTypes
optional
message = [UNSUPPORTED]

Returns

boolean