Basicly just another sugary syntax wrap around typechecking!
At the moment you can just download it! Still learning here!
isIt(opts = {}).what(input)
Get a string containing what the input is:
isIt().what(input) // Returns Function || Array || String || Event || Boolean || Integer || tells you that he couldn't figure it out.
isIt(opts = {}).object(obj)
Returns true
if the input is a object or false
if its not:
isIt().object(Object); // true
isIt().object(Function); // false
isIt().object(Array); // false
isIt(opts = {}).array(array)
Returns true
if the input is an array or false
if its not:
isIt().array(Array); // true
isIt().array(String); // false
isIt(opts = {}).func(function)
Returns true
if the input is a function or false
if its not:
isIt().func(Function); // true
isIt().func(Object); // false
isIt(opts = {}).string(string)
Returns true
if the input is a string or false
if its not:
isIt().string(String); // true
isIt().string(Array); // false
isIt(opts = {}).event(event)
Returns true
if the input is an event or false
if its not:
isIt().event(Event); // true
isIt().event(Object); // false
isIt(opts = {}).boolean(boolean)
Returns true
if the input is an boolean or false
if its not:
isIt().boolean(true); // true
isIt().boolean(false); // true
isIt().boolean(undefined); // false
isIt(opts = {}).int(int)
Returns true
if the input is an integer or false
if its not:
isIt().integer(42); // true
isIt().integer('50'); // false
isIt(opts = {}).nothing(null)
Returns true
if the input is undefined || null
or false
if its not:
isIt().nothing(null); // true
isIt().nothing(undefined); // true
isIt().nothing(false); // false
isIt(opts = {}).link(url)
Returns true
if the input is a link/url or false
if its not:
isIt().link('http://github.com'); // true
isIt().link('a plain string'); // false
isIt(opts = {}).what('string', [], {}, function () {}, false, 43, undefined, null)
isIt().what('string', [], {}, function () {}, false, 43, undefined, null)
Outputs:
["String", "Array", "Object", "Function", "Boolean", "Integer", "Nothing", "Nothing"]
Computer, internet and browser, download it from here, npm hopefully soon.
Download from github.
import it
import isIt from '../isIt';
And use
isIt().what([1,2,3,4,5]) // Array
Use your favorite bundler :) Wrote this with Parcel
vscode and my fingers. Parcel
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
0.0.1 - Thats just that!
- Anton Kristensen - Initial work - Anton Kristensen
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details