@thi.ng/memoize 3.1.18 → 3.1.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**: 2022-11-30T22:27:38Z
3
+ - **Last updated**: 2022-12-20T16:33:11Z
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,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![memoize](https://media.thi.ng/umbrella/banners-20220914/thing-memoize.svg?c436e528)
3
+ # ![@thi.ng/memoize](https://media.thi.ng/umbrella/banners-20220914/thing-memoize.svg?c436e528)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/memoize.svg)](https://www.npmjs.com/package/@thi.ng/memoize)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/memoize.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
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
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -24,7 +24,7 @@ This project is part of the
24
24
 
25
25
  ## About
26
26
 
27
- Function memoization with configurable caching.
27
+ Function memoization with configurable caching
28
28
 
29
29
  This package provides different function memoization implementations for
30
30
  functions with 1 or more arguments and custom result caching using ES6
@@ -63,11 +63,8 @@ ES module import:
63
63
 
64
64
  For Node.js REPL:
65
65
 
66
- ```text
67
- # with flag only for < v16
68
- node --experimental-repl-await
69
-
70
- > const memoize = await import("@thi.ng/memoize");
66
+ ```js
67
+ const memoize = await import("@thi.ng/memoize");
71
68
  ```
72
69
 
73
70
  Package sizes (brotli'd, pre-treeshake): ESM: 248 bytes
@@ -161,7 +158,7 @@ dotProduct([1,2], [3,4]);
161
158
 
162
159
  ## Authors
163
160
 
164
- Karsten Schmidt
161
+ - [Karsten Schmidt](https://thi.ng)
165
162
 
166
163
  If this project contributes to an academic publication, please cite it as:
167
164
 
@@ -176,4 +173,4 @@ If this project contributes to an academic publication, please cite it as:
176
173
 
177
174
  ## License
178
175
 
179
- &copy; 2018 - 2022 Karsten Schmidt // Apache Software License 2.0
176
+ &copy; 2018 - 2022 Karsten Schmidt // Apache License 2.0
package/memoize.d.ts CHANGED
@@ -2,14 +2,14 @@ import type { Fn, Fn2, Fn3, Fn4 } from "@thi.ng/api";
2
2
  import type { MapLike } from "./api.js";
3
3
  /**
4
4
  * Function memoization for arbitrary argument counts. Returns augmented
5
- * function, which uses the given `Map` implementation to obtain and
6
- * store memoized result of given args. Supports generics for up to 4
7
- * args (otherwise untyped).
5
+ * function, which uses the given `Map` implementation to obtain and store
6
+ * memoized result of given args. Supports generics for up to 4 args (otherwise
7
+ * untyped).
8
8
  *
9
- * **Important:** It only makes sense to use `Map` types which support
10
- * value (rather than object) equality, e.g. those provided by
11
- * {@link @thi.ng/associative# | @thi.ng/associative}. Using a native `Map` type here will lead
12
- * to memory leaks! Alternatively, use {@link (memoizeJ:1)}.
9
+ * **Important:** It only makes sense to use `Map` types which support value
10
+ * (rather than object) equality, e.g. those provided by
11
+ * [`thi.ng/associative`](https://thi.ng/associative). Using a native `Map` type
12
+ * here will lead to memory leaks! Alternatively, use {@link memoizeJ}.
13
13
  *
14
14
  * @param fn -
15
15
  * @param cache -
package/memoize1.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import type { Fn } from "@thi.ng/api";
2
2
  import type { MapLike } from "./api.js";
3
3
  /**
4
- * Optimized memoization for single arg functions. If the function
5
- * expects args other than strings or numbers, you MUST provide a `Map`
6
- * implementation which supports value (rather than object) equality,
7
- * e.g. one of those provided by
8
- * {@link @thi.ng/associative# | @thi.ng/associative}. Using a native
9
- * `Map` type here will lead to memory leaks! Alternatively, use
10
- * {@link (memoizeJ:1)}.
4
+ * Optimized memoization for single arg functions. If the function expects args
5
+ * other than strings or numbers, you MUST provide a `Map` implementation which
6
+ * supports value (rather than object) equality, e.g. one of those provided by
7
+ * [`thi.ng/associative`](https://thi.ng/associative). Using a native `Map` type
8
+ * here will lead to memory leaks! Alternatively, use {@link memoizeJ}.
11
9
  *
12
10
  * @param fn -
13
11
  * @param cache -
package/memoize1.js CHANGED
@@ -1,11 +1,9 @@
1
1
  /**
2
- * Optimized memoization for single arg functions. If the function
3
- * expects args other than strings or numbers, you MUST provide a `Map`
4
- * implementation which supports value (rather than object) equality,
5
- * e.g. one of those provided by
6
- * {@link @thi.ng/associative# | @thi.ng/associative}. Using a native
7
- * `Map` type here will lead to memory leaks! Alternatively, use
8
- * {@link (memoizeJ:1)}.
2
+ * Optimized memoization for single arg functions. If the function expects args
3
+ * other than strings or numbers, you MUST provide a `Map` implementation which
4
+ * supports value (rather than object) equality, e.g. one of those provided by
5
+ * [`thi.ng/associative`](https://thi.ng/associative). Using a native `Map` type
6
+ * here will lead to memory leaks! Alternatively, use {@link memoizeJ}.
9
7
  *
10
8
  * @param fn -
11
9
  * @param cache -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/memoize",
3
- "version": "3.1.18",
3
+ "version": "3.1.20",
4
4
  "description": "Function memoization with configurable caching",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
@@ -34,15 +34,15 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1"
37
+ "@thi.ng/api": "^8.6.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@microsoft/api-extractor": "^7.33.5",
41
- "@thi.ng/testament": "^0.3.6",
40
+ "@microsoft/api-extractor": "^7.33.7",
41
+ "@thi.ng/testament": "^0.3.7",
42
42
  "rimraf": "^3.0.2",
43
43
  "tools": "^0.0.1",
44
- "typedoc": "^0.23.20",
45
- "typescript": "^4.8.4"
44
+ "typedoc": "^0.23.22",
45
+ "typescript": "^4.9.4"
46
46
  },
47
47
  "keywords": [
48
48
  "cache",
@@ -89,5 +89,5 @@
89
89
  ],
90
90
  "year": 2018
91
91
  },
92
- "gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n"
92
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
93
93
  }