Skip to main content
Module

x/scaffold/src/deps/npm.ts

scaffold your next project with style and 💗
Latest
import * as mod from "https://deno.land/x/scaffold@0.3.0/src/deps/npm.ts";

Variables

Returns true whether the payload is null or undefined

Functions

An alternative to Array#includes() that properly acts as a type guard.

Cast the given value to be Mutable.

Assert that the given value is an Error.

Returns the object type of the given payload

Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)

Returns whether the payload is an array

Returns whether the payload is a Blob

Returns whether the payload is a boolean

Returns whether the payload is a Date, and that the date is valid

Check whether a value is defined, meaning it is not undefined.

Check whether an array is empty.

Returns whether the payload is a an empty array

Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)

Returns whether the payload is ''

Returns whether the payload is an Error

Returns whether the payload is a File

An alternative to Number.isFinite() that properly acts as a type guard.

Returns whether the payload is a an array with at least 1 item

Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)

Returns whether the payload is a string, BUT returns false for ''

Returns whether the payload is a function (regular or async)

Check whether a value is infinite.

An alternative to Number.isInteger() that properly acts as a type guard.

Returns whether the payload is a Map

Returns whether the payload is literally the value NaN (it's NaN and also a number)

Returns whether the payload is a negative number (but not 0)

Returns whether the payload is null

Returns whether the payload is a number (but not NaN)

Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)

Returns whether the payload is an object like a type passed in < >

Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)

Returns whether the payload is a positive number (but not 0)

Check whether a value is present (non-nullable), meaning it is neither null or undefined.

Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)

Returns whether the payload is a Promise

Returns whether the payload is a regular expression (RegExp)

An alternative to Number.isSafeInteger() that properly acts as a type guard.

Returns whether the payload is a Set

Returns whether the payload is a string

Returns whether the payload is a Symbol

Does a generic check to check that the given payload is of a given type. In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!); It will, however, differentiate between object and null

Returns whether the payload is undefined

Returns whether the payload is a WeakMap

Returns whether the payload is a WeakSet

Merge anything recursively. Objects get merged, special objects (classes etc.) are re-assigned "as is". Basic types overwrite objects or other basic types.

A strongly-typed version of Object.entries().

A strongly-typed version of Object.fromEntries().

A strongly-typed version of Object.hasOwn().

A strongly-typed version of Object.keys().

Render a template

An alternative to Set#has() that properly acts as a type guard.