Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gutil

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gutil - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

spec/uniqueSpec.js

10

lib/util/each.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc