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.9 to 3.0.10

2

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

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

@@ -264,53 +264,31 @@ 'use strict';

const comparisons = {
'==': function (key, value) {
return this.items.filter(function (item) {
return item[key] == value;
});
}.bind(this),
return new Collection(
this.items.filter(function(item) {
switch (operator) {
case '==':
return item[key] == value;
'===': function (key, value) {
return this.items.filter(function (item) {
return item[key] === value;
});
}.bind(this),
case '===':
return item[key] === value;
'!=': function (key, value) {
return this.items.filter(function (item) {
return item[key] != value;
});
}.bind(this),
case '!=':
return item[key] != value;
'!==': function (key, value) {
return this.items.filter(function (item) {
return item[key] !== value;
});
}.bind(this),
case '!==':
return item[key] !== value;
'<': function (key, value) {
return this.items.filter(function (item) {
return item[key] < value;
});
}.bind(this),
case '<':
return item[key] < value;
'<=': function (key, value) {
return this.items.filter(function (item) {
return item[key] <= value;
});
}.bind(this),
case '<=':
return item[key] <= value;
'>': function (key, value) {
return this.items.filter(function (item) {
return item[key] > value;
});
}.bind(this),
case '>':
return item[key] > value;
'>=': function (key, value) {
return this.items.filter(function (item) {
return item[key] >= value;
});
}.bind(this)
};
return new Collection(comparisons[operator](key, value));
case '>=':
return item[key] >= value;
}
})
);
};

@@ -317,0 +295,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