@nxtedition/lib 23.4.2 → 23.4.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/cache.js +4 -4
  2. package/package.json +1 -1
package/cache.js CHANGED
@@ -1,4 +1,4 @@
1
- import { LRU } from 'lru-cache'
1
+ import { LRUCache } from 'lru-cache'
2
2
 
3
3
  export class AsyncCache {
4
4
  #lru
@@ -10,7 +10,7 @@ export class AsyncCache {
10
10
  #stale
11
11
 
12
12
  constructor(location, valueSelector, keySelector, opts) {
13
- this.#lru = new LRU({ max: 1024 })
13
+ this.#lru = new LRUCache({ max: 1024 })
14
14
 
15
15
  if (typeof location === 'string') {
16
16
  this.#prefix = location + ':'
@@ -31,7 +31,7 @@ export class AsyncCache {
31
31
  }
32
32
 
33
33
  if (typeof opts?.ttl === 'number' || opts?.ttl === undefined) {
34
- const ttl = opts.ttl ?? Number.MAX_SAFE_INTEGER
34
+ const ttl = opts?.ttl ?? Number.MAX_SAFE_INTEGER
35
35
  this.#ttl = (val, key) => ttl
36
36
  } else if (typeof opts?.ttl === 'function') {
37
37
  this.#ttl = opts.ttl
@@ -40,7 +40,7 @@ export class AsyncCache {
40
40
  }
41
41
 
42
42
  if (typeof opts?.stale === 'number' || opts?.stale === undefined) {
43
- const stale = opts.stale ?? Number.MAX_SAFE_INTEGER
43
+ const stale = opts?.stale ?? Number.MAX_SAFE_INTEGER
44
44
  this.#stale = () => stale
45
45
  } else if (typeof opts?.stale === 'function') {
46
46
  this.#stale = opts.stale
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.4.2",
3
+ "version": "23.4.4",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",