@narrative.io/data-collaboration-sdk-ts 0.0.60 → 0.0.62
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/build/nql/NQLParser.js +5 -3
- package/package.json +1 -1
package/build/nql/NQLParser.js
CHANGED
|
@@ -296,7 +296,7 @@ export function buildFrom(from) {
|
|
|
296
296
|
}
|
|
297
297
|
export function buildWhere(where) {
|
|
298
298
|
NqlWhereObj.parse(where);
|
|
299
|
-
let str = 'WHERE';
|
|
299
|
+
let str = where.filterExpressions.length > 0 ? 'WHERE' : '';
|
|
300
300
|
where.filterExpressions.forEach((f, i) => {
|
|
301
301
|
if ('field' in f) {
|
|
302
302
|
str += ` ${buildField(f.field)} ${f.operator}`;
|
|
@@ -349,8 +349,10 @@ export function createSemanticWhere(expressionContainer) {
|
|
|
349
349
|
(leftObject?.field?.startsWith('_') ?? false) ||
|
|
350
350
|
(rightObject?.field?.startsWith('_') ?? false)) {
|
|
351
351
|
copy.filterExpressions.splice(index, 1);
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
if (copy.booleanExpressions.length > index) {
|
|
353
|
+
copy.booleanExpressions.splice(index, 1);
|
|
354
|
+
}
|
|
355
|
+
else if (copy.booleanExpressions.length > 0) {
|
|
354
356
|
copy.booleanExpressions.splice(index - 1, 1);
|
|
355
357
|
}
|
|
356
358
|
}
|