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

collect.js

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect.js - npm Package Compare versions

Comparing version 3.0.16 to 3.0.17

2

package.json
{
"name": "collect.js",
"version": "3.0.16",
"version": "3.0.17",
"description": "Convenient and dependency free wrapper for working with arrays and objects.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

'use strict';
module.exports = function every(fn) {
return this.items.filter(fn).length === this.items.length;
for (let i = 0; i < this.items.length; i++) {
if (!fn(this.items[i])) {
return false;
}
return true;
}
};

@@ -5,3 +5,9 @@ 'use strict';

if (typeof fn === 'function') {
return this.items.filter(fn)[0];
for (let i = 0; i < this.items.length; i++) {
const item = this.items[i];
if (fn(item)) {
return item;
}
}
return;
}

@@ -8,0 +14,0 @@

@@ -5,7 +5,8 @@ 'use strict';

if (Array.isArray(this.items)) {
return (
this.items.filter(function(item) {
return item.hasOwnProperty(key);
}).length > 0
);
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].hasOwnProperty(key)) {
return true;
}
}
return false;
}

@@ -12,0 +13,0 @@

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