@bitcobblers/wod-wiki-storage 0.59.2240 → 0.59.2244
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/dist/idb/index.cjs +24 -22
- package/dist/idb/index.cjs.map +1 -1
- package/dist/idb/index.mjs +24 -22
- package/dist/idb/index.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/idb/index.mjs
CHANGED
|
@@ -324,30 +324,32 @@ var IndexedDBStorage = class {
|
|
|
324
324
|
let pre20 = 0;
|
|
325
325
|
let migrationError;
|
|
326
326
|
this.opening = openDB(this.options.dbName ?? IDB_DB_NAME, DB_VERSION, {
|
|
327
|
-
upgrade:
|
|
328
|
-
void
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
if (oldVersion !== 0 && oldVersion < 20) {
|
|
336
|
-
pre20 = oldVersion;
|
|
337
|
-
tx.abort();
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
try {
|
|
341
|
-
createMissingStores(db, tx);
|
|
342
|
-
if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
|
|
343
|
-
await migrateSchema(db, oldVersion, tx);
|
|
344
|
-
} catch (error) {
|
|
345
|
-
migrationError = error instanceof Error ? error : new Error(String(error));
|
|
346
|
-
try {
|
|
327
|
+
upgrade: (db, oldVersion, _version, tx) => {
|
|
328
|
+
void (async () => {
|
|
329
|
+
void tx.done.catch(() => {
|
|
330
|
+
});
|
|
331
|
+
if (oldVersion > DB_VERSION) {
|
|
332
|
+
newer = true;
|
|
347
333
|
tx.abort();
|
|
348
|
-
|
|
334
|
+
return;
|
|
349
335
|
}
|
|
350
|
-
|
|
336
|
+
if (oldVersion !== 0 && oldVersion < 20) {
|
|
337
|
+
pre20 = oldVersion;
|
|
338
|
+
tx.abort();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
try {
|
|
342
|
+
createMissingStores(db, tx);
|
|
343
|
+
if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
|
|
344
|
+
await migrateSchema(db, oldVersion, tx);
|
|
345
|
+
} catch (error) {
|
|
346
|
+
migrationError = error instanceof Error ? error : new Error(String(error));
|
|
347
|
+
try {
|
|
348
|
+
tx.abort();
|
|
349
|
+
} catch {
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
})();
|
|
351
353
|
},
|
|
352
354
|
blocking: () => {
|
|
353
355
|
void this.close();
|