is.js small type testing library for node and the web
const is = require('is');
is.Arr([1,2,3,4]) // -> true
is.Object({ a : 1 , b : 2}) // -> true
is.eq('string one', 'string one') // -> true
is.eq('string two')('string two') // -> true
is - Type Testing / Assertion main object with all the methods
Determine if a String contains only characters and numbers (alphanumeric)
Parameters
str
string variable to test
Tests if a value is an arguments object
Parameters
variable
...Any to test
Test if something is an Array
Parameters
args
value/values to test
Array.isArray alias for convenience and performance when only one argument is present
Parameters
val
Any value to test
Test if something is an Array-Like
Parameters
args
value/values to test
Determines whether a Number is between a maximum and a minimum
Parameters
val
Number number value to testmax
Number maximum to compare the value withmin
Number minimum to compare the value with
Returns Boolean wether or not the value is between the max and min
Determine if a variable is of Blob type
Parameters
obj
variable to test
Test if something is a boolean type
Parameters
val
value to test
Determines if a number is BIGGER than another
Parameters
Determines if a number is BIGGER than or equal to another
Parameters
Determine if a variable is a Date type
Parameters
variable
...Any to test
Determines whether a String is a dateString
Parameters
dateString
string variable to test
Determine whether a variable is in fact defined
Parameters
args
value/values to test
Determine if a variable is a HTMLElement
Parameters
args
value/values to test
Determines whether a String is a valid Email
Parameters
email
string variable to test
Determine if a given collection or string is empty
Parameters
Determines if two variables are equal
Parameters
a
first value to compareb
second value to compare
checks if a number is an even number
Parameters
val
variable / value to test
Determine if a variable/s are false
Parameters
args
value/values to test
Determine if a variable is a File Object
Parameters
args
value/values to test
Determine if a variable is of a FormData type
Parameters
args
value/values to test
Determine if a variable is a function
Parameters
args
value/values to test
Determines if a date is in the future
Parameters
obj
Date to test
Determines whether a String is hexadecimal
Parameters
hexadecimal
string variable to test
Determines whether a String is a HEX-COLOR (#fff123)
Parameters
HexColor
string variable to test
checks if a number is an integer
Parameters
val
variable / value to test
Determine if a sring is JSON
Parameters
args
value/values to test
Determine if a String is LOWERCASE
Parameters
char
string variable to test
Determines if a number is LOWER than another
Parameters
Determines if a number is LOWER than or equal to another
Parameters
Determine if a variable is a Map
Parameters
args
value/values to test
Test if something is a Native JavaScript feature
Parameters
val
value to test
checks if a number is positive
Parameters
val
variable / value to test
Determine whether a variable is a DOM Node
Parameters
args
value/values to test
Determine whether a variable is a DOM NodeList or Collection of Nodes
Parameters
args
value/values to test
Determines if two variables are equal
Parameters
a
first value to compareb
second value to compare
Determine whether a variable is null
Parameters
args
value/values to test
Determine if a variable is a Number
Parameters
args
...Any value/values to test
Determine if a variable is an Object
Parameters
args
value/values to test
checks if a number is an odd number
Parameters
val
variable / value to test
Determines if a date is in the past
Parameters
obj
Date to test
checks if a number is positive
Parameters
val
variable / value to test
Determine if a variable is a Regular Expression
Parameters
obj
variable to test
Determine if a variable is a Set
Parameters
obj
variable to test
Test if something is a String
Parameters
args
value/values to test
Determine if a variable is a Symbol
Parameters
obj
variable to test
Test an element's tagname
Parameters
Determines whether a String is a timeString
Parameters
time
variable to test
checks wether a date is today
Parameters
obj
Date to test
checks wether a date is tommorow
Parameters
obj
Date to test
Determine if a variable/s are true
Parameters
args
value/values to test
Determine whether a variable is undefined
Parameters
args
value/values to test
Determine if a String is UPPERCASE
Parameters
char
string variable to test
Determines whether a String is a URL
Parameters
url
string variable to test
checks wether a date is yesterday
Parameters
obj
Date to test
is.js a small es6 type testing toolkit for the web and node
Meta
- copyright: MIT Licence (c) 2016 Saul van der Walt
- author: github.com/@SaulDoesCode