wat-type

0.0.18 • Public • Published

is-type.js

function utils to check type : string, number, boolean, null, undefined, object, NaN, function, RegExp, HTMLElement

Install

npm i --save wat-type

How to use

ES6 (Import/Export)

import watType from 'wat-type'

watType.watType(NaN) // NaN
watType.isString('LeeHyungGeun') // true
watType.isNumber(35) // true
watType.isBoolean(false) // true
watType.isNull(null) // true
watType.isUndefined(undefined) // true
watType.isNaN(NaN) // true
watType.isObject({}) // true
watType.isFunction(function() {}) // true
watType.isRegExp(/LeeHyungGeun/) // true

ES3

<script src="../dist/wat-type.js"></script>
<script>
watType.watType(NaN) // NaN
watType.isString('LeeHyungGeun') // true
watType.isNumber(35) // true
watType.isBoolean(false) // true
watType.isNull(null) // true
watType.isUndefined(undefined) // true
watType.isNaN(NaN) // true
watType.isObject({}) // true
watType.isFunction(function() {}) // true
watType.isRegExp(/LeeHyungGeun/) // true
watType.isHTMLElement(document.createElement('div')) // true
</script>

Readme

Keywords

Package Sidebar

Install

npm i wat-type

Weekly Downloads

9

Version

0.0.18

License

MIT

Unpacked Size

16.5 kB

Total Files

10

Last publish

Collaborators

  • leehyunggeun