@thi.ng/memoize 3.3.4 → 3.3.6
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/defonce.d.ts +0 -2
- package/defonce.js +3 -5
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-29T09:28:36Z
|
|
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
|
+
### [3.3.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/memoize@3.3.5) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
17
|
+
|
|
12
18
|
### [3.3.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/memoize@3.3.2) (2024-04-20)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 189 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
|
>
|
|
@@ -89,7 +89,7 @@ For Node.js REPL:
|
|
|
89
89
|
const mem = await import("@thi.ng/memoize");
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
Package sizes (brotli'd, pre-treeshake): ESM:
|
|
92
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 506 bytes
|
|
93
93
|
|
|
94
94
|
## Dependencies
|
|
95
95
|
|
package/defonce.d.ts
CHANGED
|
@@ -18,6 +18,4 @@ import type { Fn0 } from "@thi.ng/api";
|
|
|
18
18
|
* @param factory -
|
|
19
19
|
*/
|
|
20
20
|
export declare const defOnce: <T>(id: string, factory: Fn0<T>) => T;
|
|
21
|
-
/** @deprecated renamed to {@link defOnce} */
|
|
22
|
-
export declare const defonce: <T>(id: string, factory: Fn0<T>) => T;
|
|
23
21
|
//# sourceMappingURL=defonce.d.ts.map
|
package/defonce.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
const defOnce = (id, factory) => id in
|
|
3
|
-
const defonce = defOnce;
|
|
1
|
+
const CACHE = /* @__PURE__ */ Object.create(null);
|
|
2
|
+
const defOnce = (id, factory) => id in CACHE ? CACHE[id] : CACHE[id] = factory();
|
|
4
3
|
export {
|
|
5
|
-
defOnce
|
|
6
|
-
defonce
|
|
4
|
+
defOnce
|
|
7
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/memoize",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"description": "Function memoization with configurable caching",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/memoize",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
39
|
+
"@thi.ng/api": "^8.11.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.
|
|
43
|
-
"esbuild": "^0.21.
|
|
42
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
43
|
+
"esbuild": "^0.21.5",
|
|
44
44
|
"typedoc": "^0.25.13",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.5.2"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"cache",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
],
|
|
96
96
|
"year": 2018
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "7b950c112fba0b2e7c450765b15624c3382f1354\n"
|
|
99
99
|
}
|