@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
- let dbInstance = null;
381
+ const instances = new Map();
382
382
 
383
- export default function getAuthDatabase(dbPath = DEFAULT_DB, options = {}) {
384
- if (!dbInstance || dbInstance.disposed) {
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
- dbInstance = new AuthDatabase(dbPath, options, BufferJSON);
388
+ instances.set(dbPath, new AuthDatabase(dbPath, options, BufferJSON));
389
389
  }
390
- return dbInstance;
390
+ return instances.get(dbPath);
391
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",