@adobe/helix-shared-config 1.7.13 → 1.7.14

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.7.14](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.13...@adobe/helix-shared-config@1.7.14) (2022-02-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependency lru-cache to v7 ([#647](https://github.com/adobe/helix-shared/issues/647)) ([4feaa27](https://github.com/adobe/helix-shared/commit/4feaa27a92f7734a5277231dcfcf2ae8e935eb77))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.7.13](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.12...@adobe/helix-shared-config@1.7.13) (2022-02-10)
7
18
 
8
19
  **Note:** Version bump only for package @adobe/helix-shared-config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-shared-config",
3
- "version": "1.7.13",
3
+ "version": "1.7.14",
4
4
  "description": "Shared modules of the Helix Project - config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "cookie": "0.4.2",
33
33
  "fs-extra": "10.0.0",
34
34
  "ignore": "5.2.0",
35
- "lru-cache": "6.0.0",
35
+ "lru-cache": "7.3.1",
36
36
  "object-hash": "2.2.0",
37
37
  "uri-js": "4.4.1",
38
38
  "yaml": "1.10.2"
@@ -46,5 +46,5 @@
46
46
  "mocha": "9.2.0",
47
47
  "nock": "13.2.4"
48
48
  },
49
- "gitHead": "da4c50ef157df77520f970125bc70d76e228a0a7"
49
+ "gitHead": "c6345624913b31e312479032c417213afc2a6f5b"
50
50
  }
package/src/BaseConfig.js CHANGED
@@ -52,10 +52,20 @@ class BaseConfig {
52
52
  /**
53
53
  * Reset the cache with a new cache size
54
54
  * @param {object} options cache options
55
- * @param {number} options.maxSize
55
+ * @param {number} options.max
56
56
  */
57
57
  withCache(options) {
58
- cache.options(options);
58
+ // be backward compatible
59
+ if (!options.max && options.maxSize) {
60
+ const opts = {
61
+ ...options,
62
+ max: options.maxSize,
63
+ };
64
+ delete opts.maxSize;
65
+ cache.options(opts);
66
+ } else {
67
+ cache.options(options);
68
+ }
59
69
  return this;
60
70
  }
61
71
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  const LRU = require('lru-cache');
14
14
 
15
- let lru = new LRU({ maxSize: 1000, maxAge: 60 * 1000 });
15
+ let lru = new LRU({ max: 1000, maxAge: 60 * 1000 });
16
16
 
17
17
  /**
18
18
  * Returns a memoized version of the function `fn`.
@@ -71,7 +71,7 @@ function cache(fn, opts = {}) {
71
71
  * Resets the QuickLRU cache with new options. Existing cache entries
72
72
  * will be cleared.
73
73
  * @param {object} opts options
74
- * @param {number} opts.maxSize maximum size of the cache
74
+ * @param {number} opts.max maximum size of the cache
75
75
  */
76
76
  cache.options = (opts) => {
77
77
  lru = new LRU(opts);