@labdigital/commercetools-mock 1.3.1 → 1.3.2
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.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/lib/predicateParser.ts +2 -2
- package/src/lib/projectionSearchFilter.ts +2 -2
- package/dist/index.global.js +0 -46293
- package/dist/index.global.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -75,7 +75,7 @@ var parseExpandClause = (clause) => {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
// src/lib/predicateParser.ts
|
|
78
|
-
import
|
|
78
|
+
import perplex from "perplex";
|
|
79
79
|
import { Parser } from "pratt";
|
|
80
80
|
|
|
81
81
|
// src/lib/haversine.ts
|
|
@@ -137,7 +137,7 @@ var resolveValue = (obj, val) => {
|
|
|
137
137
|
}
|
|
138
138
|
return obj[val.value];
|
|
139
139
|
};
|
|
140
|
-
var getLexer = (value) => new
|
|
140
|
+
var getLexer = (value) => new perplex(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);
|
|
141
141
|
var generateMatchFunc = (predicate) => {
|
|
142
142
|
const lexer = getLexer(predicate);
|
|
143
143
|
const parser = new Parser(lexer).builder().nud(
|
|
@@ -3226,7 +3226,7 @@ var ProductDiscountRepository = class extends AbstractResourceRepository {
|
|
|
3226
3226
|
};
|
|
3227
3227
|
|
|
3228
3228
|
// src/lib/projectionSearchFilter.ts
|
|
3229
|
-
import
|
|
3229
|
+
import perplex2 from "perplex";
|
|
3230
3230
|
import Parser2 from "pratt";
|
|
3231
3231
|
var parseFilterExpression = (filter) => {
|
|
3232
3232
|
const exprFunc = generateMatchFunc2(filter);
|
|
@@ -3236,7 +3236,7 @@ var parseFilterExpression = (filter) => {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
return filterProduct(source, exprFunc);
|
|
3238
3238
|
};
|
|
3239
|
-
var getLexer2 = (value) => new
|
|
3239
|
+
var getLexer2 = (value) => new perplex2(value).token("MISSING", /missing(?![-_a-z0-9]+)/i).token("EXISTS", /exists(?![-_a-z0-9]+)/i).token("RANGE", /range(?![-_a-z0-9]+)/i).token("TO", /to(?![-_a-z0-9]+)/i).token("IDENTIFIER", /[-_.a-z]+/i).token("FLOAT", /\d+\.\d+/).token("INT", /\d+/).token("STRING", /"((?:\\.|[^"\\])*)"/).token("STRING", /'((?:\\.|[^'\\])*)'/).token("COMMA", ",").token("STAR", "*").token("(", "(").token(":", ":").token(")", ")").token('"', '"').token("WS", /\s+/, true);
|
|
3240
3240
|
var parseFilter = (filter) => {
|
|
3241
3241
|
const lexer = getLexer2(filter);
|
|
3242
3242
|
const parser = new Parser2(lexer).builder().nud("IDENTIFIER", 100, (t) => t.token.match).led(":", 100, ({ left, bp }) => {
|