1.0.4 • Published 5 years ago

typeiss v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

typeiss.js

It can check all data types.

Valuetypeiss.js
Undeclared variablesUndefined
undefinedUndefined
BooleanBoolean
NumberNumber
StringString
FunctionFunction
ArrayArray
ObjectObject
DateDate
RegExpRegExp
SetSet
MapMap

Installation

npm install typeiss

Usage


In ES6:

import { typeiss } from 'typeiss'

In Node.js:

const a = require('typeiss')

In a browser:

<script src="typeis.js"></script>

Examples


// return variable type
typeiss(undefined) //return Undefined
typeiss(true)     //return Boolean
typeiss('string') //return String
···

// return the variable type is or not in an array
typeiss(undefined, ['Undefined'])   //return true
typeiss(true, ['Boolean','Array'])  //return true
typeiss(true, ['Array'])            //return false
typeiss('string', ['String','Boolean','Array'])  //return true
typeiss('string', ['Boolean','Array'])           //return false
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago