flatpack-json 8.14.3 → 8.14.4

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.
Files changed (2) hide show
  1. package/dist/Flatpack.mjs +15 -0
  2. package/package.json +3 -3
package/dist/Flatpack.mjs CHANGED
@@ -504,6 +504,21 @@ export class FlatpackStore {
504
504
  assigned.set(this.refUndefined, 0);
505
505
  calcAvailableIndexes();
506
506
  addElements(this.root);
507
+ this.#cleanCache();
508
+ }
509
+ /**
510
+ * Remove objects from the cache after the FlatpackStore has been built.
511
+ */
512
+ #cleanCache() {
513
+ const toRemove = new Set();
514
+ for (const key of this.cache.keys()) {
515
+ if (key && typeof key === 'object') {
516
+ toRemove.add(key);
517
+ }
518
+ }
519
+ for (const key of toRemove) {
520
+ this.cache.delete(key);
521
+ }
507
522
  }
508
523
  toJSON() {
509
524
  const data = [dataHeader];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "8.14.3",
6
+ "version": "8.14.4",
7
7
  "description": "A library to normalize JSON objects to reduce the size.",
8
8
  "keywords": [
9
9
  "cspell",
@@ -52,8 +52,8 @@
52
52
  "node": ">=18"
53
53
  },
54
54
  "devDependencies": {
55
- "@cspell/filetypes": "8.14.3",
55
+ "@cspell/filetypes": "8.14.4",
56
56
  "diff": "^7.0.0"
57
57
  },
58
- "gitHead": "ce996377857f5d7c3e70f27fc512afbe605562f8"
58
+ "gitHead": "aeedd49f6ef20799eed04076093291fcacbc4b84"
59
59
  }