Comparing version 1.5.0 to 1.5.1
@@ -5,3 +5,3 @@ // each | ||
* @param values Array or object values | ||
* @param func Function to apply with for an array "func(value, index)" and for an object "func(value, key)" | ||
* @param func Function to apply with for an array "func(value, index, isFirst)" and for an object "func(value, key, isFirst)" | ||
*/ | ||
@@ -15,9 +15,13 @@ module.exports = function(values, func) { | ||
var length = values.length; | ||
var isFirst = true; | ||
for(var i=0; i<length; i++) { | ||
func(values[i], i); | ||
func(values[i], i, isFirst); | ||
if(isFirst) {isFirst=false;} | ||
} | ||
} | ||
else { | ||
var isFirst = true; | ||
for(var valueKey in values) { | ||
func(values[valueKey], valueKey); | ||
func(values[valueKey], valueKey, isFirst); | ||
if(isFirst) {isFirst=false;} | ||
} | ||
@@ -24,0 +28,0 @@ } |
@@ -5,5 +5,5 @@ function log(txt, txt2) { | ||
} else { | ||
console.log(txt + ":"+txt2); | ||
console.log(txt + " : "+txt2); | ||
} | ||
} | ||
module.exports=log; |
{ | ||
"name": "gutil", | ||
"description": "GUtil", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "licenses": [ |
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
48754
34
1447