@labdigital/commercetools-mock 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +7 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/predicateParser.test.ts +16 -0
- package/src/lib/predicateParser.ts +8 -1
package/dist/index.global.js
CHANGED
|
@@ -45032,7 +45032,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45032
45032
|
return obj[val.value];
|
|
45033
45033
|
};
|
|
45034
45034
|
var getLexer = (value) => {
|
|
45035
|
-
return new import_perplex.default(value).token("AND", /and(?![-_a-z0-9]+)/i).token("OR", /or(?![-_a-z0-9]+)/i).token("NOT", /not(?![-_a-z0-9]+)/i).token("WITHIN", /within(?![-_a-z0-9]+)/i).token("IN", /in(?![-_a-z0-9]+)/i).token("MATCHES_IGNORE_CASE", /matches\s+ignore\s+case(?![-_a-z0-9]+)/i).token("CONTAINS", /contains(?![-_a-z0-9]+)/i).token("ALL", /all(?![-_a-z0-9]+)/i).token("ANY", /any(?![-_a-z0-9]+)/i).token("EMPTY", /empty(?![-_a-z0-9]+)/i).token("IS", /is(?![-_a-z0-9]+)/i).token("DEFINED", /defined(?![-_a-z0-9]+)/i).token("FLOAT", /\d+\.\d+/).token("INT", /\d+/).token("VARIABLE", /:([-_A-Za-z0-9]+)/).token("IDENTIFIER", /[-_A-Za-z0-9]+/).token("STRING", /"((?:\\.|[^"\\])*)"/).token("STRING", /'((?:\\.|[^'\\])*)'/).token("COMMA", ",").token("(", "(").token(")", ")").token(">=", ">=").token("<=", "<=").token(">", ">").token("<", "<").token("!=", "!=").token("=", "=").token('"', '"').token("WS", /\s+/, true);
|
|
45035
|
+
return new import_perplex.default(value).token("AND", /and(?![-_a-z0-9]+)/i).token("OR", /or(?![-_a-z0-9]+)/i).token("NOT", /not(?![-_a-z0-9]+)/i).token("WITHIN", /within(?![-_a-z0-9]+)/i).token("IN", /in(?![-_a-z0-9]+)/i).token("MATCHES_IGNORE_CASE", /matches\s+ignore\s+case(?![-_a-z0-9]+)/i).token("CONTAINS", /contains(?![-_a-z0-9]+)/i).token("ALL", /all(?![-_a-z0-9]+)/i).token("ANY", /any(?![-_a-z0-9]+)/i).token("EMPTY", /empty(?![-_a-z0-9]+)/i).token("IS", /is(?![-_a-z0-9]+)/i).token("DEFINED", /defined(?![-_a-z0-9]+)/i).token("FLOAT", /\d+\.\d+/).token("INT", /\d+/).token("VARIABLE", /:([-_A-Za-z0-9]+)/).token("BOOLEAN", /(true|false)/).token("IDENTIFIER", /[-_A-Za-z0-9]+/).token("STRING", /"((?:\\.|[^"\\])*)"/).token("STRING", /'((?:\\.|[^'\\])*)'/).token("COMMA", ",").token("(", "(").token(")", ")").token(">=", ">=").token("<=", "<=").token(">", ">").token("<", "<").token("!=", "!=").token("=", "=").token('"', '"').token("WS", /\s+/, true);
|
|
45036
45036
|
};
|
|
45037
45037
|
var generateMatchFunc = (predicate) => {
|
|
45038
45038
|
const lexer = getLexer(predicate);
|
|
@@ -45042,6 +45042,12 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45042
45042
|
value: t.token.match,
|
|
45043
45043
|
pos: t.token.strpos()
|
|
45044
45044
|
};
|
|
45045
|
+
}).nud("BOOLEAN", 1, (t) => {
|
|
45046
|
+
return {
|
|
45047
|
+
type: "boolean",
|
|
45048
|
+
value: t.token.match === "true" ? true : false,
|
|
45049
|
+
pos: t.token.strpos()
|
|
45050
|
+
};
|
|
45045
45051
|
}).nud("VARIABLE", 100, (t) => {
|
|
45046
45052
|
return {
|
|
45047
45053
|
type: "var",
|