@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.
@@ -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
- // Make sure the booleanExpressions array has an element to remove
353
- if (index > 0 && copy.booleanExpressions.length >= index) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",