ldap-filters
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -40,36 +40,40 @@ module.exports = (function() { | ||
peg$c0 = function(filter) { return filter; }, | ||
peg$c1 = "(", | ||
peg$c2 = { type: "literal", value: "(", description: "\"(\"" }, | ||
peg$c3 = ")", | ||
peg$c4 = { type: "literal", value: ")", description: "\")\"" }, | ||
peg$c5 = "&", | ||
peg$c6 = { type: "literal", value: "&", description: "\"&\"" }, | ||
peg$c7 = function(filters) { return Filter.AND(filters); }, | ||
peg$c8 = "|", | ||
peg$c9 = { type: "literal", value: "|", description: "\"|\"" }, | ||
peg$c10 = function(filters) { return Filter.OR(filters); }, | ||
peg$c11 = "!", | ||
peg$c12 = { type: "literal", value: "!", description: "\"!\"" }, | ||
peg$c13 = function(filter) { return Filter.NOT(filter); }, | ||
peg$c14 = function(attr, comp, value) { return new Filter(attr.attribute,comp,value); }, | ||
peg$c15 = "=", | ||
peg$c16 = { type: "literal", value: "=", description: "\"=\"" }, | ||
peg$c17 = "~=", | ||
peg$c18 = { type: "literal", value: "~=", description: "\"~=\"" }, | ||
peg$c19 = ">=", | ||
peg$c20 = { type: "literal", value: ">=", description: "\">=\"" }, | ||
peg$c21 = "<=", | ||
peg$c22 = { type: "literal", value: "<=", description: "\"<=\"" }, | ||
peg$c23 = "=*", | ||
peg$c24 = { type: "literal", value: "=*", description: "\"=*\"" }, | ||
peg$c25 = function(attr) { return Filter.attribute(attr.attribute).present(); }, | ||
peg$c26 = function(attr, value) { | ||
peg$c1 = function(filter) { | ||
filter.value = filter.value.replace(/ +$/,''); | ||
return filter; | ||
}, | ||
peg$c2 = "(", | ||
peg$c3 = { type: "literal", value: "(", description: "\"(\"" }, | ||
peg$c4 = ")", | ||
peg$c5 = { type: "literal", value: ")", description: "\")\"" }, | ||
peg$c6 = "&", | ||
peg$c7 = { type: "literal", value: "&", description: "\"&\"" }, | ||
peg$c8 = function(filters) { return Filter.AND(filters); }, | ||
peg$c9 = "|", | ||
peg$c10 = { type: "literal", value: "|", description: "\"|\"" }, | ||
peg$c11 = function(filters) { return Filter.OR(filters); }, | ||
peg$c12 = "!", | ||
peg$c13 = { type: "literal", value: "!", description: "\"!\"" }, | ||
peg$c14 = function(filter) { return Filter.NOT(filter); }, | ||
peg$c15 = function(attr, comp, value) { return new Filter(attr.attribute,comp,value); }, | ||
peg$c16 = "=", | ||
peg$c17 = { type: "literal", value: "=", description: "\"=\"" }, | ||
peg$c18 = "~=", | ||
peg$c19 = { type: "literal", value: "~=", description: "\"~=\"" }, | ||
peg$c20 = ">=", | ||
peg$c21 = { type: "literal", value: ">=", description: "\">=\"" }, | ||
peg$c22 = "<=", | ||
peg$c23 = { type: "literal", value: "<=", description: "\"<=\"" }, | ||
peg$c24 = "=*", | ||
peg$c25 = { type: "literal", value: "=*", description: "\"=*\"" }, | ||
peg$c26 = function(attr) { return Filter.attribute(attr.attribute).present(); }, | ||
peg$c27 = function(attr, value) { | ||
return new Filter(attr.attribute,'=',value); | ||
}, | ||
peg$c27 = "*", | ||
peg$c28 = { type: "literal", value: "*", description: "\"*\"" }, | ||
peg$c29 = { type: "other", description: "attribute description" }, | ||
peg$c30 = ";", | ||
peg$c31 = { type: "literal", value: ";", description: "\";\"" }, | ||
peg$c32 = function(attr, opts) { | ||
peg$c28 = "*", | ||
peg$c29 = { type: "literal", value: "*", description: "\"*\"" }, | ||
peg$c30 = { type: "other", description: "attribute description" }, | ||
peg$c31 = ";", | ||
peg$c32 = { type: "literal", value: ";", description: "\";\"" }, | ||
peg$c33 = function(attr, opts) { | ||
if (opts) { | ||
@@ -83,4 +87,4 @@ opts.shift(); | ||
}, | ||
peg$c33 = { type: "other", description: "attribute Type" }, | ||
peg$c34 = function(oid) { | ||
peg$c34 = { type: "other", description: "attribute Type" }, | ||
peg$c35 = function(oid) { | ||
return { | ||
@@ -91,3 +95,3 @@ type: 'oid', | ||
}, | ||
peg$c35 = function(name) { | ||
peg$c36 = function(name) { | ||
return { | ||
@@ -98,36 +102,36 @@ type: 'attribute', | ||
}, | ||
peg$c36 = { type: "other", description: "attribute type chars" }, | ||
peg$c37 = "-", | ||
peg$c38 = { type: "literal", value: "-", description: "\"-\"" }, | ||
peg$c39 = { type: "other", description: "OID" }, | ||
peg$c40 = ".", | ||
peg$c41 = { type: "literal", value: ".", description: "\".\"" }, | ||
peg$c42 = { type: "other", description: "attribute options" }, | ||
peg$c43 = { type: "other", description: "attribute option" }, | ||
peg$c44 = /^[^)]/, | ||
peg$c45 = { type: "class", value: "[^\\x29]", description: "[^\\x29]" }, | ||
peg$c46 = "\\", | ||
peg$c47 = { type: "literal", value: "\\", description: "\"\\\\\"" }, | ||
peg$c48 = function(char) { return String.fromCharCode(char); }, | ||
peg$c49 = function(value) { return parseInt(value,16); }, | ||
peg$c50 = /^[a-fA-F0-9]/, | ||
peg$c51 = { type: "class", value: "[a-fA-F0-9]", description: "[a-fA-F0-9]" }, | ||
peg$c52 = { type: "other", description: "WHITESPACE" }, | ||
peg$c53 = { type: "other", description: "SPACE" }, | ||
peg$c54 = /^[ ]/, | ||
peg$c55 = { type: "class", value: "[\\x20]", description: "[\\x20]" }, | ||
peg$c56 = { type: "other", description: "TAB" }, | ||
peg$c57 = /^[\t]/, | ||
peg$c58 = { type: "class", value: "[\\x09]", description: "[\\x09]" }, | ||
peg$c59 = { type: "other", description: "DIGIT" }, | ||
peg$c60 = /^[0-9]/, | ||
peg$c61 = { type: "class", value: "[0-9]", description: "[0-9]" }, | ||
peg$c62 = { type: "other", description: "ALPHA" }, | ||
peg$c63 = /^[a-zA-Z]/, | ||
peg$c64 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, | ||
peg$c65 = { type: "other", description: "NEWLINE" }, | ||
peg$c66 = "\r\n", | ||
peg$c67 = { type: "literal", value: "\r\n", description: "\"\\r\\n\"" }, | ||
peg$c68 = "\n", | ||
peg$c69 = { type: "literal", value: "\n", description: "\"\\n\"" }, | ||
peg$c37 = { type: "other", description: "attribute type chars" }, | ||
peg$c38 = "-", | ||
peg$c39 = { type: "literal", value: "-", description: "\"-\"" }, | ||
peg$c40 = { type: "other", description: "OID" }, | ||
peg$c41 = ".", | ||
peg$c42 = { type: "literal", value: ".", description: "\".\"" }, | ||
peg$c43 = { type: "other", description: "attribute options" }, | ||
peg$c44 = { type: "other", description: "attribute option" }, | ||
peg$c45 = /^[^)]/, | ||
peg$c46 = { type: "class", value: "[^\\x29]", description: "[^\\x29]" }, | ||
peg$c47 = "\\", | ||
peg$c48 = { type: "literal", value: "\\", description: "\"\\\\\"" }, | ||
peg$c49 = function(char) { return String.fromCharCode(char); }, | ||
peg$c50 = function(value) { return parseInt(value,16); }, | ||
peg$c51 = /^[a-fA-F0-9]/, | ||
peg$c52 = { type: "class", value: "[a-fA-F0-9]", description: "[a-fA-F0-9]" }, | ||
peg$c53 = { type: "other", description: "WHITESPACE" }, | ||
peg$c54 = { type: "other", description: "SPACE" }, | ||
peg$c55 = /^[ ]/, | ||
peg$c56 = { type: "class", value: "[\\x20]", description: "[\\x20]" }, | ||
peg$c57 = { type: "other", description: "TAB" }, | ||
peg$c58 = /^[\t]/, | ||
peg$c59 = { type: "class", value: "[\\x09]", description: "[\\x09]" }, | ||
peg$c60 = { type: "other", description: "DIGIT" }, | ||
peg$c61 = /^[0-9]/, | ||
peg$c62 = { type: "class", value: "[0-9]", description: "[0-9]" }, | ||
peg$c63 = { type: "other", description: "ALPHA" }, | ||
peg$c64 = /^[a-zA-Z]/, | ||
peg$c65 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, | ||
peg$c66 = { type: "other", description: "NEWLINE" }, | ||
peg$c67 = "\r\n", | ||
peg$c68 = { type: "literal", value: "\r\n", description: "\"\\r\\n\"" }, | ||
peg$c69 = "\n", | ||
peg$c70 = { type: "literal", value: "\n", description: "\"\\n\"" }, | ||
@@ -320,3 +324,3 @@ peg$currPos = 0, | ||
function peg$parsestart() { | ||
var s0, s1; | ||
var s0, s1, s2; | ||
@@ -330,2 +334,25 @@ s0 = peg$currPos; | ||
s0 = s1; | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$currPos; | ||
s1 = []; | ||
s2 = peg$parseFILL(); | ||
while (s2 !== peg$FAILED) { | ||
s1.push(s2); | ||
s2 = peg$parseFILL(); | ||
} | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parseitem(); | ||
if (s2 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c1(s2); | ||
s0 = s1; | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
@@ -347,7 +374,7 @@ return s0; | ||
if (input.charCodeAt(peg$currPos) === 40) { | ||
s2 = peg$c1; | ||
s2 = peg$c2; | ||
peg$currPos++; | ||
} else { | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c2); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c3); } | ||
} | ||
@@ -358,7 +385,7 @@ if (s2 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 41) { | ||
s4 = peg$c3; | ||
s4 = peg$c4; | ||
peg$currPos++; | ||
} else { | ||
s4 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c4); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c5); } | ||
} | ||
@@ -422,7 +449,7 @@ if (s4 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 38) { | ||
s1 = peg$c5; | ||
s1 = peg$c6; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c6); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c7); } | ||
} | ||
@@ -447,3 +474,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c7(s3); | ||
s1 = peg$c8(s3); | ||
s0 = s1; | ||
@@ -475,7 +502,7 @@ } else { | ||
if (input.charCodeAt(peg$currPos) === 124) { | ||
s1 = peg$c8; | ||
s1 = peg$c9; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c9); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c10); } | ||
} | ||
@@ -500,3 +527,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c10(s3); | ||
s1 = peg$c11(s3); | ||
s0 = s1; | ||
@@ -528,7 +555,7 @@ } else { | ||
if (input.charCodeAt(peg$currPos) === 33) { | ||
s1 = peg$c11; | ||
s1 = peg$c12; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c12); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c13); } | ||
} | ||
@@ -553,3 +580,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c13(s3); | ||
s1 = peg$c14(s3); | ||
s0 = s1; | ||
@@ -618,3 +645,3 @@ } else { | ||
peg$savedPos = s0; | ||
s1 = peg$c14(s1, s2, s3); | ||
s1 = peg$c15(s1, s2, s3); | ||
s0 = s1; | ||
@@ -658,7 +685,7 @@ } else { | ||
if (input.charCodeAt(peg$currPos) === 61) { | ||
s0 = peg$c15; | ||
s0 = peg$c16; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c16); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c17); } | ||
} | ||
@@ -672,8 +699,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c17) { | ||
s0 = peg$c17; | ||
if (input.substr(peg$currPos, 2) === peg$c18) { | ||
s0 = peg$c18; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c18); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c19); } | ||
} | ||
@@ -687,8 +714,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c19) { | ||
s0 = peg$c19; | ||
if (input.substr(peg$currPos, 2) === peg$c20) { | ||
s0 = peg$c20; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c20); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c21); } | ||
} | ||
@@ -702,8 +729,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c21) { | ||
s0 = peg$c21; | ||
if (input.substr(peg$currPos, 2) === peg$c22) { | ||
s0 = peg$c22; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c22); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c23); } | ||
} | ||
@@ -720,12 +747,12 @@ | ||
if (s1 !== peg$FAILED) { | ||
if (input.substr(peg$currPos, 2) === peg$c23) { | ||
s2 = peg$c23; | ||
if (input.substr(peg$currPos, 2) === peg$c24) { | ||
s2 = peg$c24; | ||
peg$currPos += 2; | ||
} else { | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c24); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c25); } | ||
} | ||
if (s2 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c25(s1); | ||
s1 = peg$c26(s1); | ||
s0 = s1; | ||
@@ -787,3 +814,3 @@ } else { | ||
peg$savedPos = s0; | ||
s1 = peg$c26(s1, s3); | ||
s1 = peg$c27(s1, s3); | ||
s0 = s1; | ||
@@ -812,7 +839,7 @@ } else { | ||
if (input.charCodeAt(peg$currPos) === 42) { | ||
s2 = peg$c27; | ||
s2 = peg$c28; | ||
peg$currPos++; | ||
} else { | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c28); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
} | ||
@@ -830,7 +857,7 @@ if (s2 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 42) { | ||
s5 = peg$c27; | ||
s5 = peg$c28; | ||
peg$currPos++; | ||
} else { | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c28); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
} | ||
@@ -854,7 +881,7 @@ if (s5 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 42) { | ||
s5 = peg$c27; | ||
s5 = peg$c28; | ||
peg$currPos++; | ||
} else { | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c28); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
} | ||
@@ -920,7 +947,7 @@ if (s5 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 59) { | ||
s3 = peg$c30; | ||
s3 = peg$c31; | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c31); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c32); } | ||
} | ||
@@ -945,3 +972,3 @@ if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c32(s1, s2); | ||
s1 = peg$c33(s1, s2); | ||
s0 = s1; | ||
@@ -959,3 +986,3 @@ } else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c29); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c30); } | ||
} | ||
@@ -974,3 +1001,3 @@ | ||
peg$savedPos = s0; | ||
s1 = peg$c34(s1); | ||
s1 = peg$c35(s1); | ||
} | ||
@@ -1008,3 +1035,3 @@ s0 = s1; | ||
peg$savedPos = s0; | ||
s1 = peg$c35(s1); | ||
s1 = peg$c36(s1); | ||
} | ||
@@ -1016,3 +1043,3 @@ s0 = s1; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c33); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c34); } | ||
} | ||
@@ -1032,7 +1059,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 45) { | ||
s0 = peg$c37; | ||
s0 = peg$c38; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c38); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
} | ||
@@ -1044,3 +1071,3 @@ } | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c36); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c37); } | ||
} | ||
@@ -1071,7 +1098,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s5 = peg$c40; | ||
s5 = peg$c41; | ||
peg$currPos++; | ||
} else { | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c41); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c42); } | ||
} | ||
@@ -1104,7 +1131,7 @@ if (s5 !== peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s5 = peg$c40; | ||
s5 = peg$c41; | ||
peg$currPos++; | ||
} else { | ||
s5 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c41); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c42); } | ||
} | ||
@@ -1153,3 +1180,3 @@ if (s5 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c39); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c40); } | ||
} | ||
@@ -1169,7 +1196,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 59) { | ||
s3 = peg$c30; | ||
s3 = peg$c31; | ||
peg$currPos++; | ||
} else { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c31); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c32); } | ||
} | ||
@@ -1210,3 +1237,3 @@ if (s3 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c42); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c43); } | ||
} | ||
@@ -1234,3 +1261,3 @@ | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c43); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c44); } | ||
} | ||
@@ -1246,3 +1273,3 @@ | ||
if (s0 === peg$FAILED) { | ||
if (peg$c44.test(input.charAt(peg$currPos))) { | ||
if (peg$c45.test(input.charAt(peg$currPos))) { | ||
s0 = input.charAt(peg$currPos); | ||
@@ -1252,3 +1279,3 @@ peg$currPos++; | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c45); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c46); } | ||
} | ||
@@ -1265,7 +1292,7 @@ } | ||
if (input.charCodeAt(peg$currPos) === 92) { | ||
s1 = peg$c46; | ||
s1 = peg$c47; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c47); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c48); } | ||
} | ||
@@ -1276,3 +1303,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s1 = peg$c48(s2); | ||
s1 = peg$c49(s2); | ||
s0 = s1; | ||
@@ -1318,3 +1345,3 @@ } else { | ||
peg$savedPos = s0; | ||
s1 = peg$c49(s1); | ||
s1 = peg$c50(s1); | ||
} | ||
@@ -1329,3 +1356,3 @@ s0 = s1; | ||
if (peg$c50.test(input.charAt(peg$currPos))) { | ||
if (peg$c51.test(input.charAt(peg$currPos))) { | ||
s0 = input.charAt(peg$currPos); | ||
@@ -1335,3 +1362,3 @@ peg$currPos++; | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c51); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c52); } | ||
} | ||
@@ -1356,3 +1383,3 @@ | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c52); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c53); } | ||
} | ||
@@ -1367,3 +1394,3 @@ | ||
peg$silentFails++; | ||
if (peg$c54.test(input.charAt(peg$currPos))) { | ||
if (peg$c55.test(input.charAt(peg$currPos))) { | ||
s0 = input.charAt(peg$currPos); | ||
@@ -1373,3 +1400,3 @@ peg$currPos++; | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c55); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c56); } | ||
} | ||
@@ -1379,3 +1406,3 @@ peg$silentFails--; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c53); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c54); } | ||
} | ||
@@ -1390,3 +1417,3 @@ | ||
peg$silentFails++; | ||
if (peg$c57.test(input.charAt(peg$currPos))) { | ||
if (peg$c58.test(input.charAt(peg$currPos))) { | ||
s0 = input.charAt(peg$currPos); | ||
@@ -1396,3 +1423,3 @@ peg$currPos++; | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c58); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c59); } | ||
} | ||
@@ -1402,3 +1429,3 @@ peg$silentFails--; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c56); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c57); } | ||
} | ||
@@ -1414,3 +1441,3 @@ | ||
s0 = peg$currPos; | ||
if (peg$c60.test(input.charAt(peg$currPos))) { | ||
if (peg$c61.test(input.charAt(peg$currPos))) { | ||
s1 = input.charAt(peg$currPos); | ||
@@ -1420,3 +1447,3 @@ peg$currPos++; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c61); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c62); } | ||
} | ||
@@ -1431,3 +1458,3 @@ if (s1 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c59); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c60); } | ||
} | ||
@@ -1443,3 +1470,3 @@ | ||
s0 = peg$currPos; | ||
if (peg$c63.test(input.charAt(peg$currPos))) { | ||
if (peg$c64.test(input.charAt(peg$currPos))) { | ||
s1 = input.charAt(peg$currPos); | ||
@@ -1449,3 +1476,3 @@ peg$currPos++; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c64); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c65); } | ||
} | ||
@@ -1460,3 +1487,3 @@ if (s1 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c62); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c63); } | ||
} | ||
@@ -1471,16 +1498,16 @@ | ||
peg$silentFails++; | ||
if (input.substr(peg$currPos, 2) === peg$c66) { | ||
s0 = peg$c66; | ||
if (input.substr(peg$currPos, 2) === peg$c67) { | ||
s0 = peg$c67; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c67); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c68); } | ||
} | ||
if (s0 === peg$FAILED) { | ||
if (input.charCodeAt(peg$currPos) === 10) { | ||
s0 = peg$c68; | ||
s0 = peg$c69; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c69); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c70); } | ||
} | ||
@@ -1491,3 +1518,3 @@ } | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$c65); } | ||
if (peg$silentFails === 0) { peg$fail(peg$c66); } | ||
} | ||
@@ -1494,0 +1521,0 @@ |
{ | ||
"name": "ldap-filters", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Library for generating, parsing, and evaluating LDAP filters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,3 +77,15 @@ var should = require('chai').should(); | ||
it('parses a single filter without parenthesis',function(done){ | ||
var filter = 'sn=smith'; | ||
Filter.parse(filter).toString().should.be.equal('(sn=smith)'); | ||
done(); | ||
}); | ||
it('allows whitespace on single filter without parenthesis',function(done){ | ||
var filter = '\n sn=smith '; | ||
Filter.parse(filter).toString().should.be.equal('(sn=smith)'); | ||
done(); | ||
}); | ||
}); | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73961
2023