can-reflect
Advanced tools
Comparing version 1.14.4 to 1.15.0
{ | ||
"name": "can-reflect", | ||
"version": "1.14.4", | ||
"version": "1.15.0", | ||
"description": "reflection on unknown data types", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
@@ -24,5 +24,6 @@ var canSymbol = require("can-symbol"); | ||
var type = typeof list; | ||
var length = list && type !== 'boolean' && | ||
typeof list !== 'number' && | ||
"length" in list && list.length; | ||
if(type === "string" || Array.isArray(list)) { | ||
return; | ||
} | ||
var length = list && (type !== 'boolean' && type !== 'number' && "length" in list) && list.length; | ||
@@ -29,0 +30,0 @@ // var length = "length" in obj && obj.length; |
@@ -564,2 +564,13 @@ var QUnit = require('steal-qunit'); | ||
QUnit.test(".size", function(){ | ||
QUnit.equal( shapeReflections.size([1]), 1, "array"); | ||
QUnit.equal( shapeReflections.size([]), 0, "array"); | ||
QUnit.equal( shapeReflections.size("a"), 1, "string"); | ||
QUnit.equal( shapeReflections.size(""), 0, "array"); | ||
QUnit.equal( shapeReflections.size({}), 0, "empty object") | ||
QUnit.equal( shapeReflections.size({foo:"bar"}), 1, "object") | ||
}); | ||
/*QUnit.test("getAllEnumerableKeys", function(){ | ||
@@ -566,0 +577,0 @@ |
@@ -1084,9 +1084,3 @@ var canSymbol = require("can-symbol"); | ||
else if( obj ) { | ||
for(var prop in obj) { | ||
if(obj.hasOwnProperty(prop)) { | ||
count++; | ||
} | ||
} | ||
return count; | ||
return shapeReflections.getOwnEnumerableKeys(obj).length; | ||
} | ||
@@ -1093,0 +1087,0 @@ else { |
166067
4519