universe-code 0.0.72 → 0.0.73

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.
@@ -1 +1 @@
1
- export { IdbService } from './indexdb/services/idbService.mjs';
1
+ export { IdbService } from './indexdb/services/idbService.js';
@@ -1,15 +1,17 @@
1
- // idbService.mjs
2
- import { DBManager, DB } from 'universe-code';
3
- import { inject } from '@angular/core';
4
- import { IDB_CONFIG } from './idb.config.mjs';
1
+ import { DBManager, DB } from "universe-code";
5
2
 
6
3
  export class IdbService {
7
4
  db = null;
8
5
  manager = null;
9
- options = inject(IDB_CONFIG); // <-- Angular will inject the config
10
- isBrowser = typeof window !== 'undefined';
11
-
12
- constructor() {}
6
+ isBrowser = typeof window !== "undefined";
7
+
8
+ /**
9
+ * @param {Object} config - { dbName, version, storeName }
10
+ */
11
+ constructor(config) {
12
+ if (!config) throw new Error("IDB config is required");
13
+ this.options = config;
14
+ }
13
15
 
14
16
  async connect() {
15
17
  if (!this.isBrowser) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universe-code",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "description": "Universal utility functions for all JS frameworks",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -1,10 +0,0 @@
1
- // idb.config.ts
2
- import { InjectionToken } from '@angular/core';
3
-
4
- /** @typedef {Object} IdbConfig
5
- * @property {string} dbName
6
- * @property {number} version
7
- * @property {string} storeName
8
- */
9
-
10
- export const IDB_CONFIG = new InjectionToken<IdbConfig>('IDB_CONFIG');