@scayle/storefront-core 7.25.0 → 7.25.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Cache purging should not remove unrelated keys
8
+
3
9
  ## 7.25.0
4
10
 
5
11
  ### Minor Changes
@@ -33,7 +33,8 @@ class UnstorageCache {
33
33
  await Promise.all(keys.map(k => this.storage.removeItem(k)));
34
34
  }
35
35
  async purgeAll() {
36
- await this.storage.clear();
36
+ const keys = await this.storage.getKeys(this.prefix);
37
+ await Promise.all(keys.map(k => this.storage.removeItem(k)));
37
38
  }
38
39
  async set(key, value, ttl, tags = []) {
39
40
  await this.storage.setItem(this.getKey(key), value, {
@@ -27,7 +27,8 @@ export class UnstorageCache {
27
27
  await Promise.all(keys.map((k) => this.storage.removeItem(k)));
28
28
  }
29
29
  async purgeAll() {
30
- await this.storage.clear();
30
+ const keys = await this.storage.getKeys(this.prefix);
31
+ await Promise.all(keys.map((k) => this.storage.removeItem(k)));
31
32
  }
32
33
  async set(key, value, ttl, tags = []) {
33
34
  await this.storage.setItem(this.getKey(key), value, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.25.0",
3
+ "version": "7.25.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -88,7 +88,7 @@
88
88
  "rimraf": "5.0.5",
89
89
  "ts-jest": "29.1.1",
90
90
  "ts-node": "10.9.1",
91
- "unstorage": "1.9.0"
91
+ "unstorage": "1.10.1"
92
92
  },
93
93
  "optionalDependencies": {
94
94
  "redis": "4"