leoric 2.10.0-beta.1 → 2.10.1

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": "leoric",
3
- "version": "2.10.0-beta.1",
3
+ "version": "2.10.1",
4
4
  "description": "JavaScript Object-relational mapping alchemy",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/realm.js CHANGED
@@ -35,7 +35,8 @@ async function findModels(dir) {
35
35
  for (const entry of entries) {
36
36
  const extname = path.extname(entry.name);
37
37
  if (entry.isFile() && ['.js', '.mjs'].includes(extname)) {
38
- const model = require(path.join(dir, entry.name));
38
+ const exports = require(path.join(dir, entry.name));
39
+ const model = exports.__esModule ? exports.default : exports;
39
40
  if (isBone(model)) models.push(model);
40
41
  }
41
42
  }
package/src/spell.js CHANGED
@@ -387,7 +387,6 @@ class Spell {
387
387
 
388
388
  #emptySpell() {
389
389
  Object.assign(this, {
390
- columns: [],
391
390
  whereConditions: [],
392
391
  groups: [],
393
392
  orders: [],
@@ -807,6 +806,7 @@ class Spell {
807
806
  $with(...qualifiers) {
808
807
  if (this.rowCount > 0 || this.skip > 0) {
809
808
  const spell = this.dup;
809
+ spell.columns = [];
810
810
  this.#emptySpell();
811
811
  this.table = { type: 'subquery', value: spell };
812
812
  }