Comparing version 0.0.3 to 0.0.4
@@ -15,2 +15,3 @@ /* | ||
exports.deepCopy = deepCopy; | ||
exports.isEmpty = isEmpty; | ||
exports.forEachKey = forEachKey; | ||
@@ -64,2 +65,10 @@ exports.validateJsonObject = validateJsonObject; | ||
function isEmpty(obj) | ||
{ | ||
var key; | ||
for (key in obj) | ||
return (false); | ||
return (true); | ||
} | ||
function forEachKey(obj, callback) | ||
@@ -66,0 +75,0 @@ { |
{ | ||
"name": "jsprim", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "utilities for primitive JavaScript types", | ||
@@ -5,0 +5,0 @@ "main": "./lib/jsprim.js", |
@@ -12,2 +12,8 @@ # jsprim: utilities for primitive JavaScript types | ||
### isEmpty(obj) | ||
Returns true if the given object has no properties and false otherwise. This | ||
is O(1) (unlike `Object.keys(obj).length === 0`, which is O(N)). | ||
### forEachKey(obj, callback) | ||
@@ -14,0 +20,0 @@ |
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
21843
94
32