@deox/check-types
v0.0.3
Published
Utilities for checking types.
Downloads
11
Readme
@deox/check-types
Utilities for checking types.
Installation
Install the package by running the following command in terminal:
npm install @deox/check-types
Usage
The module can be imported using import
in ES Modules and require
in Common JS as shown below:
ES Modules:
// index.ts
import { isPlainObject } from "@deox/check-types";
// ...
Common JS:
// index.cjs
const { isPlainObject } = require("@deox/check-types");
// ...
API
Following functions are available:
getClass(input)
: Returns the name of constructor class ofinput
as string.isNull(arg)
: Checks whetherarg
isnull
or notisArray(arg)
: Check whetherarg
is anArray
isString(arg)
: Check whetherarg
is aString
isFunction(arg)
: Check whetherarg
is aFunction
isBigInt(arg)
: Check whetherarg
is aBigInt
isSymbol(arg)
: Check whetherarg
is aSymbol
isBoolean(arg)
: Check whetherarg
is aBoolean
isUndefined(arg)
: Check whetherarg
isundefined
isNumberAny(arg)
: Check whetherarg
is aNumber
includingNaN
andInfinity
isNaN(arg)
: Check whetherarg
isNaN
isFinite(arg)
: Check whetherarg
isNumber
and isFiniteisNumber(arg)
: Check whetherarg
is aNumber
excludingNaN
andInfinity
isObjectAny(arg)
: Check whetherarg
is anObject
includingnull
isObject(arg)
: Check whetherarg
is anObject
excludingnull
andArray
isPlainObject(arg)
: Check whetherarg
is a plain objectisRegExp(arg)
: Check whetherarg
is aRegExp
isDate(arg)
: Check whetherarg
is aDate
isURL(arg)
: Check whetherarg
is anURL
isError(arg)
: Check whetherarg
is anError