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); // falseisIt(opts = {}).array(array)
Returns true if the input is an array or false if its not:
isIt().array(Array); // true
isIt().array(String); // falseisIt(opts = {}).func(function)
Returns true if the input is a function or false if its not:
isIt().func(Function); // true
isIt().func(Object); // falseisIt(opts = {}).string(string)
Returns true if the input is a string or false if its not:
isIt().string(String); // true
isIt().string(Array); // falseisIt(opts = {}).event(event)
Returns true if the input is an event or false if its not:
isIt().event(Event); // true
isIt().event(Object); // falseisIt(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); // falseisIt(opts = {}).int(int)
Returns true if the input is an integer or false if its not:
isIt().integer(42); // true
isIt().integer('50'); // falseisIt(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); // falseisIt(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'); // falseisIt(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]) // ArrayUse 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