deep-equal
Advanced tools
Comparing version 0.1.0 to 0.1.1
19
index.js
@@ -40,4 +40,19 @@ var pSlice = Array.prototype.slice; | ||
function isArguments(object) { | ||
return Object.prototype.toString.call(object) == '[object Arguments]'; | ||
var supportsArgumentsClass = (function(){ | ||
return Object.prototype.toString.call(arguments) | ||
}) == '[object Arguments]'; | ||
if(supportsArgumentsClass) { | ||
var isArguments = function(object) { | ||
return Object.prototype.toString.call(object) == '[object Arguments]'; | ||
} | ||
} else { | ||
var isArguments = function(object){ | ||
return object && | ||
typeof object == 'object' && | ||
typeof object.length == 'number' && | ||
Object.prototype.hasOwnProperty.call(object, 'callee') && | ||
!Object.prototype.propertyIsEnumerable.call(object, 'callee') || | ||
false; | ||
} | ||
} | ||
@@ -44,0 +59,0 @@ |
{ | ||
"name" : "deep-equal", | ||
"version" : "0.1.0", | ||
"version" : "0.1.1", | ||
"description" : "node's assert.deepEqual algorithm", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
@@ -33,1 +33,15 @@ var test = require('tape'); | ||
}); | ||
test('arguments class', function (t) { | ||
t.deepEqual( | ||
(function(){return arguments})(1,2,3), | ||
(function(){return arguments})(1,2,3), | ||
"compares arguments" | ||
) | ||
t.notDeepEqual( | ||
(function(){return arguments})(1,2,3), | ||
[1,2,3], | ||
"differenciates array and arguments" | ||
) | ||
t.end(); | ||
}); |
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
6677
145