@thi.ng/memoize 3.3.4 → 3.3.5

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-05-08T18:24:31Z
3
+ - **Last updated**: 2024-06-21T19:34:38Z
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
  [![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 192 standalone projects, maintained as part
10
+ > This is one of 193 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: 515 bytes
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 cache = /* @__PURE__ */ Object.create(null);
2
- const defOnce = (id, factory) => id in cache ? cache[id] : cache[id] = factory();
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.4",
3
+ "version": "3.3.5",
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://github.com/thi-ng/umbrella/tree/develop/packages/memoize#readme",
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.2"
39
+ "@thi.ng/api": "^8.11.3"
40
40
  },
41
41
  "devDependencies": {
42
- "@microsoft/api-extractor": "^7.43.2",
43
- "esbuild": "^0.21.1",
42
+ "@microsoft/api-extractor": "^7.47.0",
43
+ "esbuild": "^0.21.5",
44
44
  "typedoc": "^0.25.13",
45
- "typescript": "^5.4.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": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
98
+ "gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
99
99
  }