fctype

https://fctype.surge.sh/ or play with it here https://codesandbox.io/s/fctype-example-48t5l

Usage no npm install needed!

<script type="module">
  import fctype from 'https://cdn.skypack.dev/fctype';
</script>

README

fctype

VIEW SAMPLES/EXAMPLES HERE

https://fctype.surge.sh/ or play with it here https://codesandbox.io/s/fctype-example-48t5l

A super-simple <1KB is checking module for JavaScript that returns a Boolean for each is check.

fctype.is(true); // Boolean
fctype.isArray([]); // true
fctype.isObject({}); // true
fctype.isString(""); // true
fctype.isDate(new Date()); // true
fctype.isRegExp(/test/i); // true
fctype.isFunction(function() {}); // true
fctype.isBoolean(true); // true
fctype.isNumber(1); // true
fctype.isNull(null); // true
fctype.isUndefined(); // true

Installing with npm

npm install fctype
# OR
yarn add fctype

Manual installation

Ensure you're using the files from the dist directory (contains compiled production-ready code). Ensure you place the script before the closing </body> tag.

<body>
    <!-- html above -->
    <script src="dist/fctype.js"></script>
    <script>
        // fctype module available
    </script>
</body>