@json-api/query-parser
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -188,35 +188,39 @@ /* | ||
peg$c27 = peg$classExpectation(["`"], true, false), | ||
peg$c28 = function(content) { | ||
peg$c28 = "'", | ||
peg$c29 = peg$literalExpectation("'", false), | ||
peg$c30 = /^[^']/, | ||
peg$c31 = peg$classExpectation(["'"], true, false), | ||
peg$c32 = function(content) { | ||
return decodeURIComponent(content.join('')); | ||
}, | ||
peg$c29 = peg$otherExpectation("symbol (i.e., a field or operator name)"), | ||
peg$c30 = /^[0-9\-.]/, | ||
peg$c31 = peg$classExpectation([["0", "9"], "-", "."], false, false), | ||
peg$c32 = function(content) { | ||
peg$c33 = peg$otherExpectation("symbol (i.e., a field or operator name)"), | ||
peg$c34 = /^[0-9\-.]/, | ||
peg$c35 = peg$classExpectation([["0", "9"], "-", "."], false, false), | ||
peg$c36 = function(content) { | ||
return { type: "Identifier", value: decodeURIComponent(content.join('')) }; | ||
}, | ||
peg$c33 = peg$otherExpectation("number"), | ||
peg$c34 = /^[0-9]/, | ||
peg$c35 = peg$classExpectation([["0", "9"]], false, false), | ||
peg$c36 = ".", | ||
peg$c37 = peg$literalExpectation(".", false), | ||
peg$c38 = function(isNegative) { | ||
peg$c37 = peg$otherExpectation("number"), | ||
peg$c38 = /^[0-9]/, | ||
peg$c39 = peg$classExpectation([["0", "9"]], false, false), | ||
peg$c40 = ".", | ||
peg$c41 = peg$literalExpectation(".", false), | ||
peg$c42 = function(isNegative) { | ||
return parseFloat(text()); | ||
}, | ||
peg$c39 = peg$otherExpectation("boolean"), | ||
peg$c40 = "false", | ||
peg$c41 = peg$literalExpectation("false", false), | ||
peg$c42 = "true", | ||
peg$c43 = peg$literalExpectation("true", false), | ||
peg$c44 = function() { | ||
peg$c43 = peg$otherExpectation("boolean"), | ||
peg$c44 = "false", | ||
peg$c45 = peg$literalExpectation("false", false), | ||
peg$c46 = "true", | ||
peg$c47 = peg$literalExpectation("true", false), | ||
peg$c48 = function() { | ||
return (text() === 'true') ? true : false; | ||
}, | ||
peg$c45 = peg$otherExpectation("null"), | ||
peg$c46 = "null", | ||
peg$c47 = peg$literalExpectation("null", false), | ||
peg$c48 = function() { | ||
peg$c49 = peg$otherExpectation("null"), | ||
peg$c50 = "null", | ||
peg$c51 = peg$literalExpectation("null", false), | ||
peg$c52 = function() { | ||
return null; | ||
}, | ||
peg$c49 = /^[^()`,&=+[\]:@$*;]/, | ||
peg$c50 = peg$classExpectation(["(", ")", "`", ",", "&", "=", "+", "[", "]", ":", "@", "$", "*", ";"], true, false), | ||
peg$c53 = /^[^()`,&=+[\]:@$*;]/, | ||
peg$c54 = peg$classExpectation(["(", ")", "`", ",", "&", "=", "+", "[", "]", ":", "@", "$", "*", ";"], true, false), | ||
@@ -814,4 +818,3 @@ peg$currPos = 0, | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c28(s2); | ||
s1 = [s1, s2, s3]; | ||
s0 = s1; | ||
@@ -830,2 +833,55 @@ } else { | ||
} | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$currPos; | ||
if (input.charCodeAt(peg$currPos) === 39) { | ||
s1 = peg$c28; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
} | ||
if (s1 !== peg$FAILED) { | ||
s2 = []; | ||
if (peg$c30.test(input.charAt(peg$currPos))) { | ||
s3 = input.charAt(peg$currPos); | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c31); } | ||
} | ||
while (s3 !== peg$FAILED) { | ||
s2.push(s3); | ||
if (peg$c30.test(input.charAt(peg$currPos))) { | ||
s3 = input.charAt(peg$currPos); | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c31); } | ||
} | ||
} | ||
if (s2 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 39) { | ||
s3 = peg$c28; | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
} | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c32(s2); | ||
s0 = s1; | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
peg$silentFails--; | ||
@@ -847,3 +903,3 @@ if (s0 === peg$FAILED) { | ||
peg$silentFails++; | ||
if (peg$c30.test(input.charAt(peg$currPos))) { | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
s2 = input.charAt(peg$currPos); | ||
@@ -853,3 +909,3 @@ peg$currPos++; | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c31); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
} | ||
@@ -887,3 +943,3 @@ peg$silentFails--; | ||
peg$savedPos = s0; | ||
s1 = peg$c32(s3); | ||
s1 = peg$c36(s3); | ||
s0 = s1; | ||
@@ -905,3 +961,3 @@ } else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c33); } | ||
} | ||
@@ -930,3 +986,3 @@ | ||
s3 = []; | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s4 = input.charAt(peg$currPos); | ||
@@ -936,3 +992,3 @@ peg$currPos++; | ||
s4 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -942,3 +998,3 @@ if (s4 !== peg$FAILED) { | ||
s3.push(s4); | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s4 = input.charAt(peg$currPos); | ||
@@ -948,3 +1004,3 @@ peg$currPos++; | ||
s4 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -958,11 +1014,11 @@ } | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s5 = peg$c36; | ||
s5 = peg$c40; | ||
peg$currPos++; | ||
} else { | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c37); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c41); } | ||
} | ||
if (s5 !== peg$FAILED) { | ||
s6 = []; | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s7 = input.charAt(peg$currPos); | ||
@@ -972,3 +1028,3 @@ peg$currPos++; | ||
s7 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -978,3 +1034,3 @@ if (s7 !== peg$FAILED) { | ||
s6.push(s7); | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s7 = input.charAt(peg$currPos); | ||
@@ -984,3 +1040,3 @@ peg$currPos++; | ||
s7 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -1019,11 +1075,11 @@ } | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s3 = peg$c36; | ||
s3 = peg$c40; | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c37); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c41); } | ||
} | ||
if (s3 !== peg$FAILED) { | ||
s4 = []; | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s5 = input.charAt(peg$currPos); | ||
@@ -1033,3 +1089,3 @@ peg$currPos++; | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -1039,3 +1095,3 @@ if (s5 !== peg$FAILED) { | ||
s4.push(s5); | ||
if (peg$c34.test(input.charAt(peg$currPos))) { | ||
if (peg$c38.test(input.charAt(peg$currPos))) { | ||
s5 = input.charAt(peg$currPos); | ||
@@ -1045,3 +1101,3 @@ peg$currPos++; | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c35); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -1066,3 +1122,3 @@ } | ||
peg$savedPos = s0; | ||
s1 = peg$c38(s1); | ||
s1 = peg$c42(s1); | ||
s0 = s1; | ||
@@ -1080,3 +1136,3 @@ } else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c33); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c37); } | ||
} | ||
@@ -1103,16 +1159,16 @@ | ||
s0 = peg$currPos; | ||
if (input.substr(peg$currPos, 5) === peg$c40) { | ||
s1 = peg$c40; | ||
if (input.substr(peg$currPos, 5) === peg$c44) { | ||
s1 = peg$c44; | ||
peg$currPos += 5; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c41); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c45); } | ||
} | ||
if (s1 === peg$FAILED) { | ||
if (input.substr(peg$currPos, 4) === peg$c42) { | ||
s1 = peg$c42; | ||
if (input.substr(peg$currPos, 4) === peg$c46) { | ||
s1 = peg$c46; | ||
peg$currPos += 4; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c43); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c47); } | ||
} | ||
@@ -1133,3 +1189,3 @@ } | ||
peg$savedPos = s0; | ||
s1 = peg$c44(); | ||
s1 = peg$c48(); | ||
s0 = s1; | ||
@@ -1147,3 +1203,3 @@ } else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c43); } | ||
} | ||
@@ -1159,8 +1215,8 @@ | ||
s0 = peg$currPos; | ||
if (input.substr(peg$currPos, 4) === peg$c46) { | ||
s1 = peg$c46; | ||
if (input.substr(peg$currPos, 4) === peg$c50) { | ||
s1 = peg$c50; | ||
peg$currPos += 4; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c47); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c51); } | ||
} | ||
@@ -1180,3 +1236,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c48(); | ||
s1 = peg$c52(); | ||
s0 = s1; | ||
@@ -1194,3 +1250,3 @@ } else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c45); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c49); } | ||
} | ||
@@ -1204,3 +1260,3 @@ | ||
if (peg$c49.test(input.charAt(peg$currPos))) { | ||
if (peg$c53.test(input.charAt(peg$currPos))) { | ||
s0 = input.charAt(peg$currPos); | ||
@@ -1210,3 +1266,3 @@ peg$currPos++; | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c50); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c54); } | ||
} | ||
@@ -1213,0 +1269,0 @@ |
{ | ||
"name": "@json-api/query-parser", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A query parser for the ?filter and ?sort param syntax used by @json-api/server", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59402
1704
0