@mikro-orm/knex 5.8.11-dev.16 → 5.8.11-dev.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "5.8.11-dev.16",
3
+ "version": "5.8.11-dev.17",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -66,9 +66,9 @@
66
66
  "@mikro-orm/core": "^5.8.10"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "5.8.11-dev.16",
70
- "@mikro-orm/entity-generator": "5.8.11-dev.16",
71
- "@mikro-orm/migrations": "5.8.11-dev.16",
69
+ "@mikro-orm/core": "5.8.11-dev.17",
70
+ "@mikro-orm/entity-generator": "5.8.11-dev.17",
71
+ "@mikro-orm/migrations": "5.8.11-dev.17",
72
72
  "better-sqlite3": "*",
73
73
  "mssql": "*",
74
74
  "mysql": "*",
@@ -393,7 +393,11 @@ class QueryBuilderHelper {
393
393
  processObjectSubCondition(cond, key, qb, method, m, type) {
394
394
  // grouped condition for one field
395
395
  let value = cond[key];
396
- if (core_1.Utils.getObjectKeysSize(value) > 1) {
396
+ const size = core_1.Utils.getObjectKeysSize(value);
397
+ if (core_1.Utils.isPlainObject(value) && size === 0) {
398
+ return;
399
+ }
400
+ if (size > 1) {
397
401
  const subCondition = Object.entries(value).map(([subKey, subValue]) => ({ [key]: { [subKey]: subValue } }));
398
402
  return subCondition.forEach(sub => this.appendQueryCondition(type, sub, qb, '$and', method));
399
403
  }
@@ -402,6 +406,7 @@ class QueryBuilderHelper {
402
406
  }
403
407
  // operators
404
408
  const op = Object.keys(core_1.QueryOperator).find(op => op in value);
409
+ /* istanbul ignore next */
405
410
  if (!op) {
406
411
  throw new Error(`Invalid query condition: ${(0, util_1.inspect)(cond)}`);
407
412
  }