New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

is2

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is2 - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

238

lib/is2.js

@@ -9,2 +9,3 @@ /**

* the definitive JavaScript type testing library
* Copyright(c) 2013 Edmond Meinfelder <edmond@stdarg.com>
* Copyright(c) 2011 Enrico Marino <enrico.marino@email.com>

@@ -16,17 +17,10 @@ * MIT license

var toString = {}.toString;
/**
* @constant
* Library version.
*/
exports.version = '0.1.5';
/**
* @name type
* Test if 'value' is a type of 'type'.
* Alias: a
* @param value value to test.
* @param {String} type type.
* @param {String} type THe name of the type.
* @return {Boolean} true if 'value' is an arguments object, false otherwise.
* @api public
*/

@@ -36,10 +30,9 @@ exports.type = function (value, type) {

};
exports.a = exports.type;
/**
* @name defined
* Test if 'value' is defined.
* Alias: def
* @param {Any} value value to test.
* @param {Any} value The value to test.
* @return {Boolean} true if 'value' is defined, false otherwise.
* @api public
*/

@@ -49,10 +42,9 @@ exports.defined = function (value) {

};
exports.def = exports.defined;
/**
* @name nullOrUndefined
* Test is 'value' is either null or undefined.
* Alias: nullOrUndef
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} True if value is null or undefined, false otherwise.
* @api public
*/

@@ -62,9 +54,8 @@ exports.nullOrUndef = function(value) {

};
exports.nullOrUndefined = exports.nullOrUndef;
/**
* @name empty
* Test if 'value' is empty. To be empty means to be an array, object or string with nothing contained.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is empty, false otherwise.
* @api public
*/

@@ -91,3 +82,2 @@ exports.empty = function (value) {

/**
* @name objEquals
* Do a deep comparision of two objects for equality. Will recurse without any limits. Meant to be

@@ -160,10 +150,8 @@ * called by equal only.

/**
* @name equal
* Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions,
* using recursion.
* Alias: eq
* @param value value.
* @param other value to compare with.
* @param {Any} value value.
* @param {Any} other value to compare with.
* @return {Boolean} true if 'value' is equal to 'other', false otherwise
* @api public
*/

@@ -204,2 +192,3 @@ exports.equal = function (value, other) {

};
exports.eq = exports.equal;

@@ -218,8 +207,6 @@ /**

/**
* @name hosted
* Test if 'key' in host is an object. To be hosted means host[value] is an object.
* @param {String} value to test.
* @param host host that may contain value.
* @param {Any} value The value to test.
* @param {Any} host Host that may contain value.
* @return {Boolean} true if 'value' is hosted by 'host', false otherwise.
* @api public
*/

@@ -234,8 +221,6 @@ exports.hosted = function (value, host) {

/**
* @name instanceOf
* Test if 'value' is an instance of 'constructor'.
* Aliases: instOf, instanceof
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is an instance of 'constructor'.
* @api public
*/

@@ -247,9 +232,8 @@ exports.instanceOf = function (value, constructor) {

};
exports.instOf = exports.instanceof = exports.instanceOf;
/**
* @name null
* Test if 'value' is null.
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is null, false otherwise.
* @api public
*/

@@ -261,8 +245,6 @@ exports.null = function (value) {

/**
* @name undefined
* Test if 'value' is undefined.
* Aliases: undef, udef
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is undefined, false otherwise.
* @api public
*/

@@ -272,10 +254,9 @@ exports.undefined = function (value) {

};
exports.udef = exports.undef = exports.undefined;
/**
* @name arguments
* Test if 'value' is an arguments object.
* Alias: args
* @param value value to test
* @param {Any} value value to test
* @return {Boolean} true if 'value' is an arguments object, false otherwise
* @api public
*/

@@ -285,10 +266,9 @@ exports.arguments = function (value) {

};
exports.args = exports.arguments;
/**
* @name array
* Test if 'value' is an array.
* Alias: ary, arry
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is an array, false otherwise.
* @api public
*/

@@ -298,10 +278,9 @@ exports.array = function (value) {

};
exports.ary = exports.arry = exports.array;
/**
* @name nonEmptyArray
* Test if 'value' is an array containing at least 1 entry.
* Aliases: nonEmptyArry, nonEmptyAry
* @param value value to test.
* @param {Any} value The value to test.
* @return {Boolean} true if 'value' is an array with at least 1 value, false otherwise.
* @api public
*/

@@ -311,10 +290,9 @@ exports.nonEmptyArray = function (value) {

};
exports.nonEmptyArry = exports.nonEmptyAry = exports.nonEmptyArray;
/**
* @name array.empty
* Test if 'value' is an empty array(like) object.
* Aliases: arguents.empty, args.empty, ary.empty, arry.empty
* @param {Array|Arguments} value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is an empty array(like), false otherwise.
* @api public
*/

@@ -324,10 +302,9 @@ exports.array.empty = function (value) {

};
exports.arguments.empty = exports.args.empty = exports.ary.empty = exports.arry.empty = exports.array.empty;
/**
* @name arrayLike
* Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
* Aliases: arraylike, arryLike, aryLike
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is an arguments object, false otherwise.
* @api public
*/

@@ -341,10 +318,9 @@ exports.arrayLike = function (value) {

};
exports.arryLike = exports.aryLike = exports.arraylike = exports.arrayLike;
/**
* @name boolean
* Test if 'value' is a boolean.
* Alias: bool
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is a boolean, false otherwise.
* @api public
*/

@@ -354,9 +330,8 @@ exports.boolean = function (value) {

};
exports.bool = exports.boolean;
/**
* @name false
* Test if 'value' is false.
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is false, false otherwise
* @api public
*/

@@ -368,7 +343,5 @@ exports.false = function (value) {

/**
* @name true
* Test if 'value' is true.
* @param {Boolean} value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is true, false otherwise.
* @api public
*/

@@ -380,7 +353,5 @@ exports.true = function (value) {

/**
* @name date
* Test if 'value' is a date.
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is a date, false otherwise.
* @api public
*/

@@ -392,3 +363,2 @@ exports.date = function (value) {

/**
* @name error
* Test if 'value' is an error object.

@@ -398,3 +368,2 @@ * Alias: err

* @return {Boolean} true if 'value' is an error object, false otherwise.
* @api public
*/

@@ -404,10 +373,9 @@ exports.error = function (value) {

};
exports.err = exports.error;
/**
* @name function
* Test if 'value' is a function.
* Alias: func
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is a function, false otherwise.
* @api public
*/

@@ -417,10 +385,9 @@ exports.function = function(value) {

};
exports.func = exports.function;
/**
* @name number
* Test if 'value' is a number.
* Alias: num
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a number, false otherwise.
* @api public
*/

@@ -430,10 +397,9 @@ exports.number = function (value) {

};
exports.num = exports.number;
/**
* @name positiveNumber
* Test if 'value' is a positive number.
* Alias: positiveNum, posNum
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a number, false otherwise.
* @api public
*/

@@ -443,10 +409,9 @@ exports.positiveNumber = function (value) {

};
exports.posNum = exports.positiveNum = exports.positiveNumber;
/**
* @name negativeNumber
* Test if 'value' is a negative number.
* Aliases: negNum, negativeNum
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a number, false otherwise.
* @api public
*/

@@ -456,10 +421,9 @@ exports.negativeNumber = function (value) {

};
exports.negNum = exports.negativeNum = exports.negativeNumber;
/**
* @name decimal
* Test if 'value' is a decimal number.
* Aliases: decimalNumber, decNum
* @param value value to test.
* @param {Any} value value to test.
* @return {Boolean} true if 'value' is a decimal number, false otherwise.
* @api public
*/

@@ -469,5 +433,5 @@ exports.decimal = function (value) {

};
exports.decNum = exports.decNumer = exports.decimal;
/**
* @name divisibleBy
* Test if 'value' is divisible by 'n'.

@@ -478,3 +442,2 @@ * Alias: divisBy

* @return {Boolean} true if 'value' is divisible by 'n', false otherwise.
* @api public
*/

@@ -488,10 +451,9 @@ exports.divisibleBy = function (value, n) {

};
exports.divisBy = exports.divisibleBy;
/**
* @name int
* Test if 'value' is an integer.
* Alias: integer
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is an integer, false otherwise.
* @api public
*/

@@ -501,10 +463,9 @@ exports.int = function (value) {

};
exports.integer = exports.int;
/**
* @name positiveInt
* Test if 'value' is a positive integer.
* Alias: posInt
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a positive integer, false otherwise.
* @api public
*/

@@ -514,10 +475,9 @@ exports.positiveInt = function (value) {

};
exports.posInt = exports.positiveInteger = exports.positiveInt;
/**
* @name negativeInt
* Test if 'value' is a negative integer.
* Aliases: negInt, negativeInteger
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a negative integer, false otherwise.
* @api public
*/

@@ -527,5 +487,5 @@ exports.negativeInt = function (value) {

};
exports.negativeInteger = exports.negInt = exports.negativeInt;
/**
* @name maximum
* Test if 'value' is greater than 'others' values.

@@ -536,3 +496,2 @@ * Alias: max

* @return {Boolean} true if 'value' is greater than 'others' values.
* @api public
*/

@@ -552,5 +511,5 @@ exports.maximum = function (value, others) {

};
exports.max = exports.maximum;
/**
* @name minimum
* Test if 'value' is less than 'others' values.

@@ -561,3 +520,2 @@ * Alias: min

* @return {Boolean} true if 'value' is less than 'others' values.
* @api public
*/

@@ -577,21 +535,8 @@ exports.minimum = function (value, others) {

};
exports.notANumber = exports.notANum = exports.nan;
/**
* @name nan
* Test if 'value' is not a number.
* Alias: notANumber, notANum
* @param value to test
* @return {Boolean} true if 'value' is not a number, false otherwise
* @api public
*/
exports.nan = function (value) {
return isNaN(value);
};
/**
* @name even
* Test if 'value' is an even number.
* @param {Number} value to test.
* @return {Boolean} true if 'value' is an even number, false otherwise.
* @api public
*/

@@ -603,7 +548,5 @@ exports.even = function (value) {

/**
* @name odd
* Test if 'value' is an odd number.
* @param {Number} value to test.
* @return {Boolean} true if 'value' is an odd number, false otherwise.
* @api public
*/

@@ -615,3 +558,2 @@ exports.odd = function (value) {

/**
* @name ge
* Test if 'value' is greater than or equal to 'other'.

@@ -622,3 +564,2 @@ * Aliases: greaterOrEq, greaterOrEqual

* @return {Boolean} true, if value is greater than or equal to other, false otherwise.
* @api public
*/

@@ -630,3 +571,2 @@ exports.ge = function (value, other) {

/**
* @name gt
* Test if 'value' is greater than 'other'.

@@ -637,3 +577,2 @@ * Aliases: greaterThan

* @return {Boolean} true, if value is greater than other, false otherwise.
* @api public
*/

@@ -643,5 +582,5 @@ exports.gt = function (value, other) {

};
exports.greaterThan = exports.gt;
/**
* @name le
* Test if 'value' is less than or equal to 'other'.

@@ -652,3 +591,2 @@ * Alias: lessThanOrEq, lessThanOrEqual

* @return {Boolean} true, if 'value' is less than or equal to 'other', false otherwise.
* @api public
*/

@@ -658,5 +596,5 @@ exports.le = function (value, other) {

};
exports.lessThanOrEq = exports.lessThanOrEqual = exports.le;
/**
* @name lt
* Test if 'value' is less than 'other'.

@@ -667,3 +605,2 @@ * Alias: lessThan

* @return {Boolean} true, if 'value' is less than 'other', false otherwise.
* @api public
*/

@@ -673,5 +610,5 @@ exports.lt = function (value, other) {

};
exports.lessThan = exports.lt;
/**
* @name within
* Test if 'value' is within 'start' and 'finish'.

@@ -683,3 +620,2 @@ * Alias: withIn

* @return {Boolean} true if 'value' is is within 'start' and 'finish', false otherwise.
* @api public
*/

@@ -689,5 +625,5 @@ exports.within = function (value, start, finish) {

};
exports.withIn = exports.within;
/**
* @name object
* Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false.

@@ -697,3 +633,2 @@ * Alias: obj

* @return {Boolean} true if 'value' is an object, false otherwise.
* @api public
*/

@@ -703,10 +638,9 @@ exports.object = function (value) {

};
exports.obj = exports.object;
/**
* @name nonEmptyObject
* Test if 'value' is an object with properties. Note: Arrays are objects.
* Alias: nonEmptyObj
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is an object, false otherwise.
* @api public
*/

@@ -716,5 +650,5 @@ exports.nonEmptyObject = function (value) {

};
exports.nonEmptyObj = exports.nonEmptyObject;
/**
* @name objectInstanceOf
* Test if 'value' is an instance type objType.

@@ -725,3 +659,2 @@ * Aliases: objInstOf, objectinstanceof

* @return {Boolean} true if 'value' is an object, false otherwise.
* @api public
*/

@@ -731,10 +664,9 @@ exports.objectInstanceof = function (objInst, objType) {

};
exports.objInstOf = exports.objectInstanceOf = exports.objectInstanceof;
/**
* @name regExp
* Test if 'value' is a regular expression.
* Alias: regexp
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a regexp, false otherwise.
* @api public
*/

@@ -744,10 +676,9 @@ exports.regexp = function (value) {

};
exports.regExp = exports.regexp;
/**
* @name str
* Test if 'value' is a string.
* Alias: str
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a string, false otherwise.
* @api public
*/

@@ -757,10 +688,9 @@ exports.string = function (value) {

};
exports.str = exports.string;
/**
* @name nonEmptyStr
* Test if 'value' is a non-empty string.
* Alias: nonEmptyStr
* @param value to test.
* @param {Any} value to test.
* @return {Boolean} true if 'value' is a non-empty string, false otherwise.
* @api public
*/

@@ -770,40 +700,2 @@ exports.nonEmptyString = function (value) {

};
/**
* Aliases.
*/
exports.a = exports.type;
exports.def = exports.defined;
exports.nullOrUndefined = exports.nullOrUndef;
exports.eq = exports.equal;
exports.instOf = exports.instanceof = exports.instanceOf;
exports.udef = exports.undef = exports.undefined;
exports.args = exports.arguments;
exports.ary = exports.arry = exports.array;
exports.nonEmptyArry = exports.nonEmptyAry = exports.nonEmptyArray;
exports.arguments.empty = exports.args.empty = exports.ary.empty = exports.arry.empty = exports.array.empty;
exports.arryLike = exports.aryLike = exports.arraylike = exports.arrayLike;
exports.bool = exports.boolean;
exports.err = exports.error;
exports.func = exports.function;
exports.num = exports.number;
exports.posNum = exports.positiveNum = exports.positiveNumber;
exports.negNum = exports.negativeNum = exports.negativeNumber;
exports.decNum = exports.decNumer = exports.decimal;
exports.divisBy = exports.divisibleBy;
exports.integer = exports.int;
exports.posInt = exports.positiveInteger = exports.positiveInt;
exports.negativeInteger = exports.negInt = exports.negativeInt;
exports.max = exports.maximum;
exports.min = exports.minimum;
exports.notANumber = exports.notANum = exports.nan;
exports.greaterThan = exports.gt;
exports.lessThanOrEq = exports.lessThanOrEqual = exports.le;
exports.lessThan = exports.lt;
exports.withIn = exports.within;
exports.obj = exports.object;
exports.nonEmptyObj = exports.nonEmptyObject;
exports.objInstOf = exports.objectInstanceOf = exports.objectInstanceof;
exports.regExp = exports.regexp;
exports.str = exports.string;
exports.nonEmptyStr = exports.nonEmptyString;
{
"name" : "is2"
, "version" : "0.0.2"
, "description" : "A type checking library where each exported function returns either true or false and does not throw."
, "version" : "0.0.3"
, "description" : "A type checking library where each exported function returns either true or false and does not throw. Also added tests."
, "tags" : [ "utilities", "JavaScript", "node.js", "validation", "type", "checking" ]

@@ -6,0 +6,0 @@ , "author" : "Enrico Marino <enrico.marino@email.com>"

@@ -5,3 +5,3 @@ is2

After finding Enrico Marino's module is, the concise syntax amazed, but there were syntax issues that made using is difficult. This fork of is fixes though issues, but the module is no longer cross-platform.
After finding Enrico Marino's module is, the concise syntax amazed, but there were syntax issues that made using is difficult. This fork of is fixes those issues, but the module is no longer cross-platform. Also, added tests via mocha which can be run using 'npm test'.

@@ -11,5 +11,3 @@ ## Installation

<code>
$ npm install is2
</code>
$ npm install is2

@@ -24,1 +22,254 @@ ## Usage

## API
- [is.type()](#exportstypevaluevaluetypestring)
- [is.defined()](#exportsdefinedvalueany)
- [is.nullOrUndef()](#exportsnullorundefvalueany)
- [is.empty()](#exportsemptyvalueany)
- [is.equal()](#exportsequalvalueanyotherany)
- [is.hosted()](#exportshostedvalueanyhostany)
- [is.instanceOf()](#exportsinstanceofvalueany)
- [is.null()](#exportsnullvalueany)
- [is.undefined()](#exportsundefinedvalueany)
- [is.arguments()](#exportsargumentsvalueany)
- [is.array()](#exportsarrayvalueany)
- [is.nonEmptyArray()](#exportsnonemptyarrayvalueany)
- [is.array.empty()](#exportsarrayemptyvalueany)
- [is.arrayLike()](#exportsarraylikevalueany)
- [is.boolean()](#exportsbooleanvalueany)
- [is.false()](#exportsfalsevalueany)
- [is.true()](#exportstruevalueany)
- [is.date()](#exportsdatevalueany)
- [is.error()](#exportserrorvaluevalue)
- [is.function()](#exportsfunctionvalueany)
- [is.number()](#exportsnumbervalueany)
- [is.positiveNumber()](#exportspositivenumbervalueany)
- [is.negativeNumber()](#exportsnegativenumbervalueany)
- [is.decimal()](#exportsdecimalvalueany)
- [is.divisibleBy()](#exportsdivisiblebyvaluenumbernnumber)
- [is.int()](#exportsintvalueany)
- [is.positiveInt()](#exportspositiveintvalueany)
- [is.negativeInt()](#exportsnegativeintvalueany)
- [is.maximum()](#exportsmaximumvaluenumberothersarray)
- [is.minimum()](#exportsminimumvaluenumberothersarray)
- [is.even()](#exportsevenvaluenumber)
- [is.odd()](#exportsoddvaluenumber)
- [is.ge()](#exportsgevaluenumberothernumber)
- [is.gt()](#exportsgtvaluenumberothernumber)
- [is.le()](#exportslevaluenumberothernumber)
- [is.lt()](#exportsltvaluenumberothernumber)
- [is.within()](#exportswithinvaluenumberstartnumberfinishnumber)
- [is.object()](#exportsobjectvalueany)
- [is.nonEmptyObject()](#exportsnonemptyobjectvalueany)
- [is.objectInstanceof()](#exportsobjectinstanceofobjinstobjectobjtypeobject)
- [is.regexp()](#exportsregexpvalueany)
- [is.string()](#exportsstringvalueany)
- [is.nonEmptyString()](#exportsnonemptystringvalueany)
### is.type(value:value, type:String)
Test if 'value' is a type of 'type'.
Alias: a
### is.defined(value:Any)
Test if 'value' is defined.
Alias: def
### is.nullOrUndef(value:Any)
Test is 'value' is either null or undefined.
Alias: nullOrUndef
### is.empty(value:Any)
Test if 'value' is empty. To be empty means to be an array, object or string with nothing contained.
### is.equal(value:Any, other:Any)
Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions,
using recursion.
Alias: eq
### is.hosted(value:Any, host:Any)
Test if 'key' in host is an object. To be hosted means host[value] is an object.
### is.instanceOf(value:Any)
Test if 'value' is an instance of 'constructor'.
Aliases: instOf, instanceof
### is.null(value:Any)
Test if 'value' is null.
### is.undefined(value:Any)
Test if 'value' is undefined.
Aliases: undef, udef
### is.arguments(value:Any)
Test if 'value' is an arguments object.
Alias: args
### is.array(value:Any)
Test if 'value' is an array.
Alias: ary, arry
### is.nonEmptyArray(value:Any)
Test if 'value' is an array containing at least 1 entry.
Aliases: nonEmptyArry, nonEmptyAry
### is.array.empty(value:Any)
Test if 'value' is an empty array(like) object.
Aliases: arguents.empty, args.empty, ary.empty, arry.empty
### is.arrayLike(value:Any)
Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
Aliases: arraylike, arryLike, aryLike
### is.boolean(value:Any)
Test if 'value' is a boolean.
Alias: bool
### is.false(value:Any)
Test if 'value' is false.
### is.true(value:Any)
Test if 'value' is true.
### is.date(value:Any)
Test if 'value' is a date.
### is.error(value:value)
Test if 'value' is an error object.
Alias: err
### is.function(value:Any)
Test if 'value' is a function.
Alias: func
### is.number(value:Any)
Test if 'value' is a number.
Alias: num
### is.positiveNumber(value:Any)
Test if 'value' is a positive number.
Alias: positiveNum, posNum
### is.negativeNumber(value:Any)
Test if 'value' is a negative number.
Aliases: negNum, negativeNum
### is.decimal(value:Any)
Test if 'value' is a decimal number.
Aliases: decimalNumber, decNum
### is.divisibleBy(value:Number, n:Number)
Test if 'value' is divisible by 'n'.
Alias: divisBy
### is.int(value:Any)
Test if 'value' is an integer.
Alias: integer
### is.positiveInt(value:Any)
Test if 'value' is a positive integer.
Alias: posInt
### is.negativeInt(value:Any)
Test if 'value' is a negative integer.
Aliases: negInt, negativeInteger
### is.maximum(value:Number, others:Array)
Test if 'value' is greater than 'others' values.
Alias: max
### is.minimum(value:Number, others:Array)
Test if 'value' is less than 'others' values.
Alias: min
### is.even(value:Number)
Test if 'value' is an even number.
### is.odd(value:Number)
Test if 'value' is an odd number.
### is.ge(value:Number, other:Number)
Test if 'value' is greater than or equal to 'other'.
Aliases: greaterOrEq, greaterOrEqual
### is.gt(value:Number, other:Number)
Test if 'value' is greater than 'other'.
Aliases: greaterThan
### is.le(value:Number, other:Number)
Test if 'value' is less than or equal to 'other'.
Alias: lessThanOrEq, lessThanOrEqual
### is.lt(value:Number, other:Number)
Test if 'value' is less than 'other'.
Alias: lessThan
### is.within(value:Number, start:Number, finish:Number)
Test if 'value' is within 'start' and 'finish'.
Alias: withIn
### is.object(value:Any)
Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false.
Alias: obj
### is.nonEmptyObject(value:Any)
Test if 'value' is an object with properties. Note: Arrays are objects.
Alias: nonEmptyObj
### is.objectInstanceof(objInst:object, objType:object)
Test if 'value' is an instance type objType.
Aliases: objInstOf, objectinstanceof
### is.regexp(value:Any)
Test if 'value' is a regular expression.
Alias: regexp
### is.string(value:Any)
Test if 'value' is a string.
Alias: str
### is.nonEmptyString(value:Any)
Test if 'value' is a non-empty string.
Alias: nonEmptyStr

@@ -90,3 +90,3 @@ var assert = require('assert');

}
function Rectangle(top_len, side_len) {

@@ -479,3 +479,3 @@ this.edges = 4;

assert.equal(false, is.nan('')); // false converted to 0
assert.equal(true, is.nan('blabla'));
assert.equal(true, is.nan('blabla'));
assert.equal(true, is.nan(NaN));

@@ -619,3 +619,3 @@ })

this.area = 4;
}
}
function Polygon() {

@@ -625,4 +625,4 @@ this.edges = 8; // octogons are the default

this.area = 1;
}
}
function Rectangle(top_len, side_len) {

@@ -633,3 +633,3 @@ this.edges = 4;

this.area = top_len*side_len;
}
}
Rectangle.prototype = new Polygon;

@@ -636,0 +636,0 @@ var box = new Rectangle(8,3);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc