@thi.ng/cache 2.2.18 → 2.2.20

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-07-06T12:02:18Z
3
+ - **Last updated**: 2024-07-22T13:15:57Z
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.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
  <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- # ![@thi.ng/cache](https://media.thi.ng/umbrella/banners-20230807/thing-cache.svg?ea002c07)
3
+ # ![@thi.ng/cache](https://media.thi.ng/umbrella/banners-20230807/thing-cache.svg?4dc85e1d)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/cache.svg)](https://www.npmjs.com/package/@thi.ng/cache)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/cache.svg)
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 188 standalone projects, maintained as part
10
+ > This is one of 198 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
  >
@@ -58,7 +58,7 @@ strategies](https://en.wikipedia.org/wiki/Cache_replacement_policies).
58
58
 
59
59
  ## Related packages
60
60
 
61
- - [@thi.ng/associative](https://github.com/thi-ng/umbrella/tree/develop/packages/associative) - Alternative Map and Set implementations with customizable equality semantics & supporting operations, plain object utilities
61
+ - [@thi.ng/associative](https://github.com/thi-ng/umbrella/tree/develop/packages/associative) - ES Map/Set-compatible implementations with customizable equality semantics & supporting operations
62
62
 
63
63
  ## Installation
64
64
 
@@ -86,13 +86,14 @@ For Node.js REPL:
86
86
  const cache = await import("@thi.ng/cache");
87
87
  ```
88
88
 
89
- Package sizes (brotli'd, pre-treeshake): ESM: 1.06 KB
89
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.05 KB
90
90
 
91
91
  ## Dependencies
92
92
 
93
93
  - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
94
94
  - [@thi.ng/dcons](https://github.com/thi-ng/umbrella/tree/develop/packages/dcons)
95
- - [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
95
+
96
+ Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
96
97
 
97
98
  ## Usage examples
98
99
 
package/lru.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { DCons } from "@thi.ng/dcons/dcons";
2
- import { map } from "@thi.ng/transducers/map";
3
2
  class LRUCache {
4
3
  map;
5
4
  items;
@@ -31,14 +30,14 @@ class LRUCache {
31
30
  [Symbol.iterator]() {
32
31
  return this.entries();
33
32
  }
34
- entries() {
35
- return map((e) => [e.k, e], this.items);
33
+ *entries() {
34
+ for (let e of this.items) yield [e.k, e];
36
35
  }
37
- keys() {
38
- return map((e) => e.k, this.items);
36
+ *keys() {
37
+ for (let e of this.items) yield e.k;
39
38
  }
40
- values() {
41
- return map((e) => e.v, this.items);
39
+ *values() {
40
+ for (let e of this.items) yield e.v;
42
41
  }
43
42
  copy() {
44
43
  const c = this.empty();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/cache",
3
- "version": "2.2.18",
3
+ "version": "2.2.20",
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,8 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.5",
40
- "@thi.ng/dcons": "^3.2.117",
41
- "@thi.ng/transducers": "^9.0.9"
39
+ "@thi.ng/api": "^8.11.7",
40
+ "@thi.ng/dcons": "^3.2.119"
42
41
  },
43
42
  "devDependencies": {
44
43
  "@microsoft/api-extractor": "^7.47.0",
@@ -90,5 +89,5 @@
90
89
  ],
91
90
  "year": 2018
92
91
  },
93
- "gitHead": "ba4f2cd15eeb0cae30efe222524da4fed2a57267\n"
92
+ "gitHead": "324d6b7dbf31558329e9fb6452e29b2f7db9c61a\n"
94
93
  }