Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "wodge", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "a wodge of functional dough", | ||
@@ -5,0 +5,0 @@ "main": "wodge.js", |
20
wodge.js
@@ -28,1 +28,21 @@ exports.extend = function(obj, srcObj){ | ||
} | ||
exports.isNumber = function(n){ | ||
return !isNaN(parseFloat(n)) && isFinite(n); | ||
}; | ||
exports.arrayify = function(arr){ | ||
if (arr === null || arr === undefined){ | ||
return []; | ||
} else { | ||
return Array.isArray(arr) ? arr : [ arr ]; | ||
} | ||
}; | ||
exports.every = function(obj, callback){ | ||
var every = true; | ||
for (var prop in obj){ | ||
every = every && callback(obj[prop], prop); | ||
} | ||
return every; | ||
}; |
1287
41