@thi.ng/cache 2.2.10 → 2.2.12
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 +7 -1
- package/README.md +2 -2
- package/api.d.ts +2 -2
- package/lru.d.ts +2 -2
- package/mru.d.ts +2 -1
- package/package.json +6 -7
- package/tlru.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-23T07:02:17Z
|
|
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
|
@@ -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://
|
|
78
|
+
<script type="module" src="https://esm.run/@thi.ng/cache"></script>
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
[
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "2.2.12",
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build": "yarn build:esbuild && yarn build:decl",
|
|
28
28
|
"build:decl": "tsc --declaration --emitDeclarationOnly",
|
|
29
29
|
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
30
|
-
"clean": "
|
|
30
|
+
"clean": "bun ../../tools/src/clean-package.ts",
|
|
31
31
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
32
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
@@ -36,14 +36,13 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.
|
|
40
|
-
"@thi.ng/dcons": "^3.2.
|
|
41
|
-
"@thi.ng/transducers": "^9.0.
|
|
39
|
+
"@thi.ng/api": "^8.11.1",
|
|
40
|
+
"@thi.ng/dcons": "^3.2.111",
|
|
41
|
+
"@thi.ng/transducers": "^9.0.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.43.0",
|
|
45
45
|
"esbuild": "^0.20.2",
|
|
46
|
-
"rimraf": "^5.0.5",
|
|
47
46
|
"typedoc": "^0.25.12",
|
|
48
47
|
"typescript": "^5.4.3"
|
|
49
48
|
},
|
|
@@ -91,5 +90,5 @@
|
|
|
91
90
|
],
|
|
92
91
|
"year": 2018
|
|
93
92
|
},
|
|
94
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
|
|
95
94
|
}
|
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
|
|
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
|