@thi.ng/cache 2.2.9 → 2.2.11

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,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-08T14:59:29Z
3
+ - **Last updated**: 2024-04-20T14:42:45Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [2.2.11](https://github.com/thi-ng/umbrella/tree/@thi.ng/cache@2.2.11) (2024-04-20)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update type usage ([a3833d0](https://github.com/thi-ng/umbrella/commit/a3833d0))
17
+
12
18
  ### [2.2.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/cache@2.2.1) (2024-03-11)
13
19
 
14
20
  #### 🩹 Bug fixes
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 191 standalone projects, maintained as part
10
+ > This is one of 192 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -75,10 +75,10 @@ import * as cache from "@thi.ng/cache";
75
75
  Browser ESM import:
76
76
 
77
77
  ```html
78
- <script type="module" src="https://cdn.skypack.dev/@thi.ng/cache"></script>
78
+ <script type="module" src="https://esm.run/@thi.ng/cache"></script>
79
79
  ```
80
80
 
81
- [Skypack documentation](https://docs.skypack.dev/)
81
+ [JSDelivr documentation](https://www.jsdelivr.com/)
82
82
 
83
83
  For Node.js REPL:
84
84
 
package/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Fn, Fn0, Fn2, Fn3, ICopy, IEmpty, ILength, IRelease } from "@thi.ng/api";
1
+ import type { Fn, Fn0, Fn2, Fn3, ICopy, IEmpty, ILength, IRelease, Maybe } from "@thi.ng/api";
2
2
  export interface ICache<K, V> extends Iterable<Readonly<[K, CacheEntry<K, V>]>>, ICopy<ICache<K, V>>, IEmpty<ICache<K, V>>, ILength, IRelease {
3
3
  readonly size: number;
4
4
  /**
@@ -14,7 +14,7 @@ export interface ICache<K, V> extends Iterable<Readonly<[K, CacheEntry<K, V>]>>,
14
14
  * @param key
15
15
  * @param notFound
16
16
  */
17
- get(key: K, notFound?: V): V | undefined;
17
+ get(key: K, notFound?: V): Maybe<V>;
18
18
  /**
19
19
  * Set or updates value for given `key` and updates cache internal
20
20
  * statistics (depending on cache policy).
package/lru.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Fn0, Nullable } from "@thi.ng/api";
1
+ import type { Fn0, Maybe, Nullable } from "@thi.ng/api";
2
2
  import type { ConsCell } from "@thi.ng/dcons";
3
3
  import { DCons } from "@thi.ng/dcons/dcons";
4
4
  import type { CacheEntry, CacheOpts, ICache } from "./api.js";
@@ -26,6 +26,6 @@ export declare class LRUCache<K, V> implements ICache<K, V> {
26
26
  protected resetEntry(e: ConsCell<CacheEntry<K, V>>): V;
27
27
  protected ensureSize(): boolean;
28
28
  protected removeEntry(e: ConsCell<CacheEntry<K, V>>): void;
29
- protected doSetEntry(e: ConsCell<CacheEntry<K, V>> | undefined, k: K, v: V, s: number): void;
29
+ protected doSetEntry(e: Maybe<ConsCell<CacheEntry<K, V>>>, k: K, v: V, s: number): void;
30
30
  }
31
31
  //# sourceMappingURL=lru.d.ts.map
package/mru.d.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import type { Maybe } from "@thi.ng/api";
1
2
  import type { ConsCell } from "@thi.ng/dcons";
2
3
  import type { CacheEntry } from "./api.js";
3
4
  import { LRUCache } from "./lru.js";
4
5
  export declare class MRUCache<K, V> extends LRUCache<K, V> {
5
6
  empty(): MRUCache<K, V>;
6
7
  protected resetEntry(e: ConsCell<CacheEntry<K, V>>): V;
7
- protected doSetEntry(e: ConsCell<CacheEntry<K, V>> | undefined, k: K, v: V, s: number): void;
8
+ protected doSetEntry(e: Maybe<ConsCell<CacheEntry<K, V>>>, k: K, v: V, s: number): void;
8
9
  }
9
10
  //# sourceMappingURL=mru.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/cache",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,9 +36,9 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.10.0",
40
- "@thi.ng/dcons": "^3.2.108",
41
- "@thi.ng/transducers": "^9.0.0"
39
+ "@thi.ng/api": "^8.11.0",
40
+ "@thi.ng/dcons": "^3.2.110",
41
+ "@thi.ng/transducers": "^9.0.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "^7.43.0",
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "year": 2018
93
93
  },
94
- "gitHead": "85ac4bd4d6d89f8e3689e2863d5bea0cecdb371c\n"
94
+ "gitHead": "8339d05ecc857e529c7325a9839c0063b89e728d\n"
95
95
  }
package/tlru.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Fn0, Nullable } from "@thi.ng/api";
1
+ import type { Fn0, Maybe, Nullable } from "@thi.ng/api";
2
2
  import type { ConsCell, DCons } from "@thi.ng/dcons";
3
3
  import type { CacheEntry, CacheOpts } from "./api.js";
4
4
  import { LRUCache } from "./lru.js";
@@ -49,6 +49,6 @@ export declare class TLRUCache<K, V> extends LRUCache<K, V> {
49
49
  */
50
50
  prune(): number;
51
51
  protected ensureSize(): boolean;
52
- protected doSetEntry(e: ConsCell<TLRUCacheEntry<K, V>> | undefined, k: K, v: V, s: number, ttl?: number): void;
52
+ protected doSetEntry(e: Maybe<ConsCell<TLRUCacheEntry<K, V>>>, k: K, v: V, s: number, ttl?: number): void;
53
53
  }
54
54
  //# sourceMappingURL=tlru.d.ts.map