Socket
Socket
Sign inDemoInstall

sift

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sift - npm Package Compare versions

Comparing version 0.1.0 to 0.2.1

sift.browser.js

2

package.json
{
"name": "sift",
"description": "mongodb query style array filtering",
"version": "0.1.0",
"version": "0.2.1",
"repository": {},

@@ -6,0 +6,0 @@ "engines": {},

@@ -455,3 +455,3 @@ /*

//build the filter for the sifter
var filter = _queryParser.parse( query );
var filter = _queryParser.parse(query);

@@ -471,25 +471,8 @@ //the function used to sift through the given array

//priority = -1? it's not something we can use.
if(!~(priority = filter.priority( testValue ))) continue;
if(!~(priority = filter.priority(testValue))) continue;
//push all the sifted values to be sorted later. This is important particularly for statements
//such as $or
sifted.push({
value: value,
priority: priority
});
sifted.push(value);
}
//sort the values
sifted.sort(function(a, b) {
return a.priority > b.priority ? -1 : 1;
});
var values = Array(sifted.length);
//finally, fetch the values & return them.
for(var i = sifted.length; i--;) {
values[i] = sifted[i].value;
}
return values;
return sifted;
}

@@ -535,2 +518,3 @@

if(options.operators) sift.useOperators(options.operators);
if (typeof options === "function") options(sift);
}

@@ -537,0 +521,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