Package Exports
- typeverifier
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typeverifier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
typeverifier
Small utility class to get and check variable types.
Instalation
You can directly install it via npm using npm install typeverifier command.
In ES6 syntax you would import it with the command: import typeverifier from 'typeverifier';.
In ES5 syntax you would write: var typeverifier = require('typeverifier');
Usage
Let's presume you've imported the module using ES6 modules.
import typeverifier from 'typeverifier';
The following methods are available and return true or false.
typeverifier.defined(val)- Whethervalis an defined or not (notundefinedornull)typeverifier.null(val)- Whethervalisnulltypeverifier.string(val)- Whethervalis aStringor nottypeverifier.number(val)- Whethervalis aNumberor nottypeverifier.boolean(val)- Whethervalis aBooleanor nottypeverifier.array(val)- Whethervalis anArrayor nottypeverifier.object(val)- Whethervalis anObjector nottypeverifier.emptyObject(val)- Whethervalis an emptyObjector nottypeverifier.regex(val)- Whethervalis aRegExpor nottypeverifier.date(val)- Whethervalis aDateor nottypeverifier.func(val)- Whethervalis aFunctionor nottypeverifier.error(val)- Whethervalis anErroror nottypeverifier.instanceOf(val, name)- Whethervalis an instance of the class whose name is identical to thenameparameter