@harperfast/schema-codegen 1.0.1 → 1.0.3

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/config.yaml CHANGED
@@ -1 +1 @@
1
- extensionModule: ./extensionModule.ts
1
+ extensionModule: ./extensionModule.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harperfast/schema-codegen",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "commitlint": "commitlint --edit",
@@ -1,5 +1,4 @@
1
1
  /** @typedef {import('harperdb').Table} Table */
2
- import { databases as hdbDatabases } from 'harperdb';
3
2
 
4
3
  /**
5
4
  * @returns {(Table & { databaseName: string })[]}
@@ -7,13 +6,12 @@ import { databases as hdbDatabases } from 'harperdb';
7
6
  export function collectTables() {
8
7
  /** @type {(Table & { databaseName: string })[]} */
9
8
  const tablesList = [];
10
- for (const dbName of Object.keys(hdbDatabases || {})) {
11
- const tables = hdbDatabases[dbName];
9
+ for (const databaseName of Object.keys(databases || {})) {
10
+ const tables = databases[databaseName];
12
11
  for (const tableName of Object.keys(tables || {})) {
13
12
  const TableClass = tables[tableName];
14
13
  if (!TableClass?.attributes) { continue; }
15
- TableClass.databaseName = dbName;
16
- tablesList.push(/** @type {Table & { databaseName: string }} */ (TableClass));
14
+ tablesList.push(TableClass);
17
15
  }
18
16
  }
19
17
  return tablesList;