kc-is

[js] Check datatype only not to write typeof.

Usage no npm install needed!

<script type="module">
  import kcIs from 'https://cdn.skypack.dev/kc-is';
</script>

README

Is datatype

[js] Check datatype only not to write typeof.

Install

npm install kc-is

Use

var is = require('kc-is');
is.def('a'); // is defined
is.str('a'); // is string
is.num('a'); // is number
is.arr([]);  // is array
is.obj({});  // is object
is.fun('a'); // is function
is.rgx(/a/ig); // is regexp