workers-qb 1.6.6 → 1.6.7

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 CHANGED
@@ -524,8 +524,9 @@ var QueryBuilder = class {
524
524
  conditions = value.conditions;
525
525
  }
526
526
  if (typeof conditions === "string") return ` WHERE ${conditions.toString()}`;
527
- if (conditions.length > 0) {
528
- return ` WHERE ${conditions.join(" AND ")}`;
527
+ if (conditions.length === 1) return ` WHERE ${conditions[0].toString()}`;
528
+ if (conditions.length > 1) {
529
+ return ` WHERE (${conditions.join(") AND (")})`;
529
530
  }
530
531
  return "";
531
532
  }
package/dist/index.mjs CHANGED
@@ -484,8 +484,9 @@ var QueryBuilder = class {
484
484
  conditions = value.conditions;
485
485
  }
486
486
  if (typeof conditions === "string") return ` WHERE ${conditions.toString()}`;
487
- if (conditions.length > 0) {
488
- return ` WHERE ${conditions.join(" AND ")}`;
487
+ if (conditions.length === 1) return ` WHERE ${conditions[0].toString()}`;
488
+ if (conditions.length > 1) {
489
+ return ` WHERE (${conditions.join(") AND (")})`;
489
490
  }
490
491
  return "";
491
492
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workers-qb",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "Zero dependencies Query Builder for Cloudflare Workers",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",