@react-foundry/memoize 0.1.8 → 0.2.0

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/dist/index.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.memoize = void 0;
4
- const memoize = (f) => {
1
+ export const memoize = (f) => {
5
2
  const memo = new Map();
6
3
  return (a) => {
7
4
  const cached = memo.get(a);
@@ -15,5 +12,4 @@ const memoize = (f) => {
15
12
  }
16
13
  };
17
14
  };
18
- exports.memoize = memoize;
19
- exports.default = exports.memoize;
15
+ export default memoize;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@react-foundry/memoize",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "Higher-order functions for memoizing pure functions.",
5
+ "type": "module",
5
6
  "main": "dist/index.js",
6
7
  "exports": {
7
8
  ".": {
8
9
  "types": "./dist/index.d.ts",
9
- "import": "./dist/index.mjs",
10
- "require": "./dist/index.js",
11
- "default": "./dist/index.mjs"
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
12
  }
13
13
  },
14
14
  "files": [
@@ -23,16 +23,14 @@
23
23
  "@jest/globals": "30.3.0",
24
24
  "jest": "30.3.0",
25
25
  "jest-environment-jsdom": "30.3.0",
26
- "ts-jest": "29.4.6",
26
+ "ts-jest": "29.4.9",
27
27
  "typescript": "5.9.3"
28
28
  },
29
29
  "scripts": {
30
30
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
31
- "build": "npm run build:esm && npm run build:cjs",
32
- "build:esm": "tsc -m es2022 && find dist -name '*.js' -exec sh -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\;",
33
- "build:cjs": "tsc",
31
+ "build": "tsc",
34
32
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
35
33
  },
36
- "module": "dist/index.mjs",
34
+ "module": "dist/index.js",
37
35
  "typings": "dist/index.d.ts"
38
36
  }
package/dist/index.mjs DELETED
@@ -1,15 +0,0 @@
1
- export const memoize = (f) => {
2
- const memo = new Map();
3
- return (a) => {
4
- const cached = memo.get(a);
5
- if (cached === undefined) {
6
- const result = f(a);
7
- memo.set(a, result);
8
- return result;
9
- }
10
- else {
11
- return cached;
12
- }
13
- };
14
- };
15
- export default memoize;