Browse Source

fix: save data copy to memory

Sv443 10 months ago
parent
commit
c796187733
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/DataStore.ts

+ 1 - 1
lib/DataStore.ts

@@ -117,7 +117,7 @@ export class DataStore<TData = any> {
       if(gmFmtVer < this.formatVersion && this.migrations)
         parsed = await this.runMigrations(parsed, gmFmtVer);
 
-      return { ...(this.cachedData = parsed) };
+      return this.cachedData = { ...parsed };
     }
     catch(err) {
       console.warn("Error while parsing JSON data, resetting it to the default value.", err);