object-sizeof
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -21,3 +21,4 @@ // Copyright 2014 Andrei Karpushonak | ||
for (var key in object) { | ||
if (!object.hasOwnProperty(key)) { | ||
if(!Object.hasOwnProperty.call(object, key)) { | ||
continue; | ||
@@ -24,0 +25,0 @@ } |
{ | ||
"name": "object-sizeof", | ||
"version": "1.1.0", | ||
"description": "Sizeof of a JavaScript object in bytes", | ||
"version": "1.1.1", | ||
"description": "Sizeof of a JavaScript object in Bytes", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -12,5 +12,3 @@ "use strict"; | ||
var badData = {"1":{"depot_id":null,"hierarchy_node_id":null}}; | ||
console.log('size', sizeof(badData)); | ||
sizeof(badData); | ||
isNaN(sizeof(badData)).should.be.equal(false); | ||
sizeof(badData).should.be.instanceOf(Number); | ||
}); | ||
@@ -70,2 +68,8 @@ | ||
it('handle hasOwnProperty key', function() { | ||
sizeof({hasOwnProperty: undefined}).should.be.instanceOf(Number); | ||
sizeof({hasOwnProperty: 'Hello World'}).should.be.instanceOf(Number); | ||
sizeof({hasOwnProperty: 1234}).should.be.instanceOf(Number); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
7118
109