Skip to main content
Module

x/unknownutil/is.ts

🦕 A lightweight utility pack for handling unknown type
Go to Latest
import * as unknownutil from "https://deno.land/x/unknownutil@v3.18.0/is.ts";

Functions

f
isAllOf
deprecated

Return a type predicate function that returns true if the type of x is IntersectionOf<T>.

Assume x is anyand always returntrueregardless of the type ofx`.

Return true if the type of x is unknown[].

Return a type predicate function that returns true if the type of x is T[].

Return true if the type of x is function (async function).

Return true if the type of x is bigint.

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 is instance of ctor.

Return a type predicate function that returns true if the type of x is IntersectionOf<T>.

Return a type predicate function that returns true if the type of x is a literal type of pred.

Return a type predicate function that returns true if the type of x is one of literal type in preds.

Return true if the type of x is Map<unknown, unknown>.

Return a type predicate function that returns true if the type of x is Map<K, T>.

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 a type predicate function that returns true if the type of x is ObjectOf<T>.

Return a type predicate function that returns true if the type of x is Omit<ObjectOf<T>, K>.

f
isOneOf
deprecated

Return a type predicate function that returns true if the type of x is UnionOf<T>.

Return true if the type of predicate function x is annotated as Optional

Return an Optional annotated type predicate function that returns true if the type of x is T or undefined.

Return a type predicate function that returns true if the type of x is ParametersOf<T> or ParametersOf<T, E>.

Return a type predicate function that returns true if the type of x is Partial<ObjectOf<T>>.

Return a type predicate function that returns true if the type of x is Pick<ObjectOf<T>, K>.

Return true if the type of x is Primitive.

Return true if the type of predicate function x is annotated as Readonly

Return an Readonly annotated type predicate function that returns true if the type of x is T.

Return a type predicate function that returns true if the type of x is Readonly<TupleOf<T>>.

Return a type predicate function that returns true if the type of x is Readonly<UniformTupleOf<T>>.

Return true if the type of x satisfies Record<PropertyKey, unknown>.

f
isRecordLike
deprecated

Return true if the type of x is like Record<PropertyKey, unknown>.

f
isRecordLikeOf
deprecated

Return a type predicate function that returns true if the type of x satisfies Record<K, T>.

Return true if the type of x is an object instance that satisfies Record<PropertyKey, unknown>.

Return a type predicate function that returns true if the type of x is an Object instance that satisfies Record<K, T>.

Return a type predicate function that returns true if the type of x satisfies Record<K, T>.

Return a type predicate function that returns true if the type of x is Required<ObjectOf<T>>.

Return true if the type of x is Set<unknown>.

Return a type predicate function that returns true if the type of x is Set<T>.

Return a type predicate function that returns true if the type of x is strictly follow the ObjectOf<T>.

Return true if the type of x is string.

Return true if the type of x is symbol.

Return true if the type of x is function (non async function).

Return a type predicate function that returns true if the type of x is TupleOf<T> or TupleOf<T, E>.

Return true if the type of x is undefined.

Return a type predicate function that returns true if the type of x is UniformTupleOf<T>.

Return a type predicate function that returns true if the type of x is UnionOf<T>.

Assume x is unknown and always return true regardless of the type of x.

Return an Optional un-annotated type predicate function that returns true if the type of x is T.

Return an Readonly un-annotated type predicate function that returns true if the type of x is T.

Type Aliases

A type predicate function.

A type predicated by Predicate.