@ryuu-reinzz/haruka-lib 3.5.0 → 3.5.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.
|
@@ -378,14 +378,14 @@ class AuthDatabase {
|
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
|
|
381
|
+
const instances = new Map();
|
|
382
382
|
|
|
383
|
-
export default function getAuthDatabase(dbPath
|
|
384
|
-
if (!
|
|
383
|
+
export default function getAuthDatabase(dbPath, options = {}) {
|
|
384
|
+
if (!instances.has(dbPath) || instances.get(dbPath).disposed) {
|
|
385
385
|
const {
|
|
386
386
|
BufferJSON
|
|
387
387
|
} = options;
|
|
388
|
-
|
|
388
|
+
instances.set(dbPath, new AuthDatabase(dbPath, options, BufferJSON));
|
|
389
389
|
}
|
|
390
|
-
return
|
|
390
|
+
return instances.get(dbPath);
|
|
391
391
|
}
|