miktam/sizeof

SizeOf returns NAN when object has a property that is null.

michaelbushby opened this issue · 1 comments

//Sorry my first issue wasn't clear Please see the below example.

var _ = require('lodash');
var sizeof = require('object-sizeof');

var badData = {"1":{"depot_id":null,"hierarchy_node_id":null}};

var foo = sizeof(badData);
if(_.isNaN(foo)) {
console.log("I Am NAN");
console.log(JSON.stringify(badData));
} else {
console.log("I Am OK");
}

@michaelbushby you are absolutely right, I will fix it