Skip to main content
Module

x/unknownutil/mod.ts

🦕 An utility pack for handling unknown type in deno
Go to Latest
import * as unknownutil from "https://deno.land/x/unknownutil@v2.1.0/mod.ts";

Classes

An error raised by type assertion functions

Functions

Ensure that x is array, and raise AssertError if it is not.

Ensure that x is boolean, and raise AssertError if it is not.

Ensure that x is function, and raise AssertError if it is not.

Ensure that x follows the type of ref, and raise AssertError if it is not.

Ensure that x is null, and raise AssertError if it is not.

Ensure that x is null or undefined, and raise AssertError if it is not.

Ensure that x is number, and raise AssertError if it is not.

Ensure that x is object, and raise AssertError if it is not.

Ensure that x is string, and raise AssertError if it is not.

Ensure that x is undefined, and raise AssertError if it is not.

Return x as-is if x is array or raise an EnsureError when it's not.

Return x as-is if x is boolean or raise an EnsureError when it's not.

Return x as-is if x is function or raise an EnsureError when it's not.

Return x as-is if x follows the reference or raise an EnsureError when it doesn't.

Return x as-is if x is null or raise an EnsureError when it's not.

Return x as-is if x is null or undefined or raise an EnsureError when it's not.

Return x as-is if x is number or raise an EnsureError when it's not.

Return x as-is if x is object or raise an EnsureError when it's not.

Return x as-is if x is string or raise an EnsureError when it's not.

Return x as-is if x is undefined or raise an EnsureError when it's not.

Return true if the type of x is array.

Return true if the type of x is boolean.

Return true if the type of x is function.

Return true if the type of x follows the type of ref.

Return true if the type of x is null.

Return true if the type of x is null or undefined.

Return true if the type of x is number.

Return true if the type of x is object.

Return true if the type of x is string.

Return true if the type of x is undefined.

Return x as-is if the type of the value is array or undefined if not.

Return x as-is if the type of the value is boolean or undefined if not.

Return x as-is if the type of the value is function or undefined if not.

Return x as-is if the type of the value follow the reference or undefined if not.

Return x as-is if the type of the value is number or undefined if not.

Return x as-is if the type of the value is object or undefined if not.

Return x as-is if the type of the value is string or undefined if not.

Type Aliases

A type decision function