Comparing version 0.1.0 to 0.1.1
111
is.js
@@ -23,8 +23,14 @@ | ||
var is = exports.is = {}; | ||
exports.is = {}; | ||
/** | ||
* Test if 'value' is an arguments object | ||
* Library version. | ||
*/ | ||
is.version = 0.1.1; | ||
/** | ||
* Test if 'value' is a type of 'type'. | ||
* | ||
* @param value value to test | ||
* @param {String} type type | ||
* @return {Boolean} true if 'value' is an arguments object, false otherwise | ||
@@ -34,2 +40,14 @@ * @api public | ||
is.a = function (value, type) { | ||
return typeof value === type; | ||
}; | ||
/** | ||
* Test if 'value' is an arguments object. | ||
* | ||
* @param value value to test | ||
* @return {Boolean} true if 'value' is an arguments object, false otherwise | ||
* @api public | ||
*/ | ||
is.arguments = function (value) { | ||
@@ -40,3 +58,3 @@ return '[object Arguments]' === toString.call(value); | ||
/** | ||
* Test if 'value' is an array | ||
* Test if 'value' is an array. | ||
* | ||
@@ -53,3 +71,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is an empty array(like) object | ||
* Test if 'value' is an empty array(like) object. | ||
* | ||
@@ -66,3 +84,3 @@ * @param {Array|Arguments} value value to test | ||
/** | ||
* Test if 'value' is an arraylike object | ||
* Test if 'value' is an arraylike object. | ||
* | ||
@@ -81,3 +99,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is a boolean | ||
* Test if 'value' is a boolean. | ||
* | ||
@@ -94,3 +112,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is a date | ||
* Test if 'value' is a date. | ||
* | ||
@@ -107,3 +125,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is a decimal number | ||
* Test if 'value' is a decimal number. | ||
* | ||
@@ -121,3 +139,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is defined | ||
* Test if 'value' is defined. | ||
* | ||
@@ -134,3 +152,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is divisible by 'n' | ||
* Test if 'value' is divisible by 'n'. | ||
* | ||
@@ -150,3 +168,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is an html element | ||
* Test if 'value' is an html element. | ||
* | ||
@@ -165,3 +183,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is empty | ||
* Test if 'value' is empty. | ||
* | ||
@@ -195,3 +213,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is an error object | ||
* Test if 'value' is an error object. | ||
* | ||
@@ -208,3 +226,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is equal to 'other' | ||
* Test if 'value' is equal to 'other'. | ||
* | ||
@@ -260,3 +278,3 @@ * @param value value | ||
/** | ||
* Test if 'value' is an even number | ||
* Test if 'value' is an even number. | ||
* | ||
@@ -273,3 +291,3 @@ * @param {Number} value to test | ||
/** | ||
* Test if 'value' is false | ||
* Test if 'value' is false. | ||
* | ||
@@ -286,3 +304,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is a function | ||
* Test if 'value' is a function. | ||
* | ||
@@ -299,3 +317,3 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is hosted by 'host' | ||
* Test if 'value' is hosted by 'host'. | ||
* | ||
@@ -314,3 +332,3 @@ * @param {String} value to test | ||
/** | ||
* Test if 'value' is greater than or equal to 'other' | ||
* Test if 'value' is greater than or equal to 'other'. | ||
* | ||
@@ -328,3 +346,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is greater than 'other' | ||
* Test if 'value' is greater than 'other'. | ||
* | ||
@@ -342,3 +360,15 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is an integer | ||
* Test if 'value' is an instance of 'constructor'. | ||
* | ||
* @param value value to test | ||
* @return {Boolean} true if 'value' is an instance of 'constructor' | ||
* @api public | ||
*/ | ||
is.instanceof = function (value, constructor) { | ||
return value instanceof constructor; | ||
}; | ||
/** | ||
* Test if 'value' is an integer. | ||
* | ||
@@ -355,3 +385,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is not a number | ||
* Test if 'value' is not a number. | ||
* | ||
@@ -368,3 +398,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is less than or equal to 'other' | ||
* Test if 'value' is less than or equal to 'other'. | ||
* | ||
@@ -382,3 +412,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is less than 'other' | ||
* Test if 'value' is less than 'other'. | ||
* | ||
@@ -396,3 +426,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is greater than 'others' values | ||
* Test if 'value' is greater than 'others' values. | ||
* | ||
@@ -418,3 +448,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is less than 'others' values | ||
* Test if 'value' is less than 'others' values. | ||
* | ||
@@ -440,3 +470,3 @@ * @param {Number} value value to test | ||
/** | ||
* Test if 'value' is null | ||
* Test if 'value' is null. | ||
* | ||
@@ -453,3 +483,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is a number | ||
* Test if 'value' is a number. | ||
* | ||
@@ -466,3 +496,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is an odd number | ||
* Test if 'value' is an odd number. | ||
* | ||
@@ -479,3 +509,3 @@ * @param {Number} value to test | ||
/** | ||
* Test if 'value' is an object | ||
* Test if 'value' is an object. | ||
* | ||
@@ -492,3 +522,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is a regular expression | ||
* Test if 'value' is a regular expression. | ||
* | ||
@@ -505,3 +535,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is a string | ||
* Test if 'value' is a string. | ||
* | ||
@@ -518,3 +548,3 @@ * @param value to test | ||
/** | ||
* Test if 'value' is true | ||
* Test if 'value' is true. | ||
* | ||
@@ -531,3 +561,3 @@ * @param {Boolean} value to test | ||
/** | ||
* Test if 'value' is undefined | ||
* Test if 'value' is undefined. | ||
* | ||
@@ -543,2 +573,15 @@ * @param value value to test | ||
/** | ||
* Test if 'value' is within 'start' and 'finish'. | ||
* | ||
* @param {Number} value value to test | ||
* @param {Number} start lower bound | ||
* @param {Number} finish upper bound | ||
* @return {Boolean} true if 'value' is is within 'start' and 'finish' | ||
* @api public | ||
*/ | ||
is.within = function (value, start, finish) { | ||
return value >= start && value <= finish; | ||
} | ||
}(this)); |
@@ -22,3 +22,3 @@ { | ||
"main": "is.js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"devDependencies": {}, | ||
@@ -25,0 +25,0 @@ "engines": { |
@@ -9,2 +9,3 @@ # is | ||
- a (value, type) | ||
- arguments (value) | ||
@@ -29,2 +30,3 @@ - array (value) | ||
- gt (value) | ||
- instanceof (value, constructor) | ||
- int (value) | ||
@@ -44,2 +46,3 @@ - nan (value) | ||
- undefined (value) | ||
- within (value, start, finish) | ||
@@ -46,0 +49,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15597
461
69
0