wtf-is-this

Type checker for JS

Usage no npm install needed!

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

README

WTF is this?

wtf-is-this is a basic JS validation and helper library

Why?

We tried different packages while building our apps, eventually we find out either those are too big or to limited for us to use..

Installation

yarn add wtf-is-this or npm install wtf-is-this --save

Usage

import is from "wtf-is-this" or import { isString } from "wtf-is-this"

Available Helpers

Depends on how you import...

is.string(val) or isString(val)

is.object(val) or isObject(val)

is.date(val) or isDate(val)

is.fn(val) or isFunction(val)

is.array(val) or isArray(val)

is.float(val) or isFloat(val)

is.integer(val) or isInteger(val)

is.number(val) or isNumber(val)

is.regexp(val) or isRegExp(val)

is.boolean(val) or isBoolean(val)

is.empty(val) or isEmpty(val)

is.ISO8601(val) or isISO8601(val)

is.color(val) or isColor(val)

is.null(val) or isNull(val)

method names explains themselves...


Contribute

Pull requests are welcome and please submit bugs 🐛.

Contact