universe-code 0.0.52 → 0.0.55

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,4 +1,4 @@
1
- import { idbService } from './services/idbService.ts';
1
+ import { idbService } from './services/idbService';
2
2
 
3
3
  // Export everything as a unified object or individual pieces
4
4
  export { idbService };
@@ -1,18 +1,18 @@
1
1
  let config = null;
2
2
 
3
3
  export const configureIdb = (options) => {
4
- if (!options || !options.dbName || !options.storeName) {
5
- throw new Error("configureIdb requires dbName and storeName");
6
- }
7
-
8
- config = options;
4
+ if (config) {
5
+ console.warn("IndexedDB already configured");
6
+ return;
7
+ }
8
+ config = options;
9
9
  };
10
10
 
11
11
  export const getConfig = () => {
12
- if (!config) {
13
- throw new Error(
14
- "IndexedDB not configured. Call configureIdb() before using the store."
15
- );
16
- }
17
- return config;
12
+ if (!config) {
13
+ throw new Error(
14
+ "IndexedDB not configured. Call configureIdb() before using the store."
15
+ );
16
+ }
17
+ return config;
18
18
  };
@@ -22,8 +22,8 @@ const connectDB = async () => {
22
22
 
23
23
  export const getIdbStore = async () => {
24
24
  if (!store) {
25
- const database = await connectDB();
26
25
  const { storeName } = getConfig(); // ✅ FIXED
26
+ const database = await connectDB();
27
27
 
28
28
  store = {
29
29
  get: (key) => DB.get(database, storeName, key),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universe-code",
3
- "version": "0.0.52",
3
+ "version": "0.0.55",
4
4
  "description": "Universal utility functions for all JS frameworks",
5
5
  "license": "ISC",
6
6
  "type": "module",