New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

filtres

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filtres - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "filtres",
"version": "0.1.2",
"version": "0.1.3",
"description": "A simple, safe, ElasticSearch Query compiler",

@@ -5,0 +5,0 @@ "main": "filtres.js",

@@ -13,4 +13,2 @@ /**

(function () {
"use strict";
var queryBase = '{"query" : {"filtered" : { "filter": [',

@@ -28,33 +26,39 @@ queryEnd = ']}}}',

}
var tree = compileExpression.parser.parse(expression);
var js = [];
js.push(queryBase);
function toJs(node) {
if (Array.isArray(node)) {
node.forEach(toJs);
} else {
js.push(node);
var tree, queryIsValid = true;
try {
tree = compileExpression.parser.parse(expression);
var js = [];
js.push(queryBase);
function toJs(node) {
if (Array.isArray(node)) {
node.forEach(toJs);
} else {
js.push(node);
}
}
tree.forEach(toJs);
js.push(queryEnd);
} catch (err) {
if (debug) console.log(err);
queryIsValid = false;
}
tree.forEach(toJs);
js.push(queryEnd);
if (debug) console.log(expression, tree, js);
try {
if (queryIsValid) {
return JSON.parse(js.join(''));
} catch (err) {
if (failToQuerystring) {
return {
"query" : {
"query_string" : {
"query": expression.replace(queryCleaner, '')
}
} else if (failToQuerystring) {
return {
"query" : {
"query_string" : {
"query": expression.replace(queryCleaner, '')
}
};
} else {
if (debug) console.log("ERROR", js.join(''));
throw err;
}
}
};
} else {
if (debug) console.log("ERROR", js && js.lenght? js.join('') : 'Parse failed');
throw "Invalid Query";
}

@@ -61,0 +65,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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