use-memo-map 0.2.0-main.08721dd → 0.2.0-main.202512240232.6aacbf9

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/useMemoMap.ts","../src/private/usePrevious.ts"],"sourcesContent":["import useMemoMap from './useMemoMap';\n\nexport { useMemoMap };\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useRefFrom } from 'use-ref-from';\n\nimport usePrevious from './private/usePrevious';\n\ntype UseMemoMapOptions<T> = {\n itemEquality?: (this: readonly T[], x: T, y: T) => boolean;\n};\n\n/**\n * Creates a memoized mapping function.\n *\n * Unlike `React.useMemo`, the mapping function can be called multiple times in a single render loop.\n * All calls to the mapping function will be memoized.\n *\n * The memoized arguments and return values will survive next render.\n *\n * When the mapping function change, all memoized values will be invalidated.\n */\nexport default function useMemoMap<T = unknown, R = unknown>(\n mapper: (this: readonly T[], item: T, index: -1, array: readonly T[]) => R,\n { itemEquality = Object.is }: UseMemoMapOptions<T> = {}\n): (array: readonly T[]) => readonly R[] {\n const itemEqualityRef = useRefFrom(itemEquality);\n const lastCallsRef = useRef<readonly [T, R][]>([]);\n const mapperRef = useRefFrom(mapper);\n const thisCalls: [T, R][] = [];\n\n if (usePrevious(mapper) !== mapper) {\n lastCallsRef.current = [];\n }\n\n useEffect(() => {\n lastCallsRef.current = Object.freeze(thisCalls);\n });\n\n const thisCallsRef = useRefFrom(thisCalls);\n\n return useCallback<(array: readonly T[]) => readonly R[]>(\n (array: readonly T[]) => {\n const { current: itemEquality } = itemEqualityRef;\n const { current: mapper } = mapperRef;\n const { current: thisCalls } = thisCallsRef;\n\n return <readonly R[]>Object.freeze(\n array.map<R>(item => {\n const thisCall = thisCalls.find(entry => itemEquality.call(array, item, entry[0]));\n\n // If this call has memoized in the current render loop, use the memoized return value.\n if (thisCall) {\n return thisCall[1];\n }\n\n const lastCall = lastCallsRef.current.find(entry => itemEquality.call(array, item, entry[0]));\n const result = lastCall ? lastCall[1] : mapper.call(array, item, -1, array);\n\n thisCalls.push([item, result]);\n\n return result;\n })\n );\n },\n [itemEqualityRef, lastCallsRef, mapperRef, thisCallsRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T, initialValue?: T): T | undefined {\n const ref = useRef<T | undefined>(initialValue);\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA+C;AAC/C,0BAA2B;;;ACD3B,mBAAkC;AAEnB,SAAR,YAAgC,OAAU,cAAiC;AAChF,QAAM,UAAM,qBAAsB,YAAY;AAE9C,8BAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;;;ADSe,SAAR,WACL,QACA,EAAE,eAAe,OAAO,GAAG,IAA0B,CAAC,GACf;AACvC,QAAM,sBAAkB,gCAAW,YAAY;AAC/C,QAAM,mBAAe,sBAA0B,CAAC,CAAC;AACjD,QAAM,gBAAY,gCAAW,MAAM;AACnC,QAAM,YAAsB,CAAC;AAE7B,MAAI,YAAY,MAAM,MAAM,QAAQ;AAClC,iBAAa,UAAU,CAAC;AAAA,EAC1B;AAEA,+BAAU,MAAM;AACd,iBAAa,UAAU,OAAO,OAAO,SAAS;AAAA,EAChD,CAAC;AAED,QAAM,mBAAe,gCAAW,SAAS;AAEzC,aAAO;AAAA,IACL,CAAC,UAAwB;AACvB,YAAM,EAAE,SAASC,cAAa,IAAI;AAClC,YAAM,EAAE,SAASC,QAAO,IAAI;AAC5B,YAAM,EAAE,SAASC,WAAU,IAAI;AAE/B,aAAqB,OAAO;AAAA,QAC1B,MAAM,IAAO,UAAQ;AACnB,gBAAM,WAAWA,WAAU,KAAK,WAASF,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAGjF,cAAI,UAAU;AACZ,mBAAO,SAAS,CAAC;AAAA,UACnB;AAEA,gBAAM,WAAW,aAAa,QAAQ,KAAK,WAASA,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAC5F,gBAAM,SAAS,WAAW,SAAS,CAAC,IAAIC,QAAO,KAAK,OAAO,MAAM,IAAI,KAAK;AAE1E,UAAAC,WAAU,KAAK,CAAC,MAAM,MAAM,CAAC;AAE7B,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,cAAc,WAAW,YAAY;AAAA,EACzD;AACF;","names":["import_react","itemEquality","mapper","thisCalls"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/useMemoMap.ts","../src/private/usePrevious.ts"],"sourcesContent":["import useMemoMap from './useMemoMap.ts';\n\nexport { useMemoMap };\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useRefFrom } from 'use-ref-from';\n\nimport usePrevious from './private/usePrevious.ts';\n\ntype UseMemoMapOptions<T> = {\n itemEquality?: (this: readonly T[], x: T, y: T) => boolean;\n};\n\n/**\n * Creates a memoized mapping function.\n *\n * Unlike `React.useMemo`, the mapping function can be called multiple times in a single render loop.\n * All calls to the mapping function will be memoized.\n *\n * The memoized arguments and return values will survive next render.\n *\n * When the mapping function change, all memoized values will be invalidated.\n */\nexport default function useMemoMap<T = unknown, R = unknown>(\n mapper: (this: readonly T[], item: T, index: -1, array: readonly T[]) => R,\n { itemEquality = Object.is }: UseMemoMapOptions<T> = {}\n): (array: readonly T[]) => readonly R[] {\n const itemEqualityRef = useRefFrom(itemEquality);\n const lastCallsRef = useRef<readonly [T, R][]>([]);\n const mapperRef = useRefFrom(mapper);\n const thisCalls: [T, R][] = [];\n\n if (usePrevious(mapper) !== mapper) {\n lastCallsRef.current = [];\n }\n\n useEffect(() => {\n lastCallsRef.current = Object.freeze(thisCalls);\n });\n\n const thisCallsRef = useRefFrom(thisCalls);\n\n return useCallback<(array: readonly T[]) => readonly R[]>(\n (array: readonly T[]) => {\n const { current: itemEquality } = itemEqualityRef;\n const { current: mapper } = mapperRef;\n const { current: thisCalls } = thisCallsRef;\n\n return <readonly R[]>Object.freeze(\n array.map<R>(item => {\n const thisCall = thisCalls.find(entry => itemEquality.call(array, item, entry[0]));\n\n // If this call has memoized in the current render loop, use the memoized return value.\n if (thisCall) {\n return thisCall[1];\n }\n\n const lastCall = lastCallsRef.current.find(entry => itemEquality.call(array, item, entry[0]));\n const result = lastCall ? lastCall[1] : mapper.call(array, item, -1, array);\n\n thisCalls.push([item, result]);\n\n return result;\n })\n );\n },\n [itemEqualityRef, lastCallsRef, mapperRef, thisCallsRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T, initialValue?: T): T | undefined {\n const ref = useRef<T | undefined>(initialValue);\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA+C;AAC/C,0BAA2B;;;ACD3B,mBAAkC;AAEnB,SAAR,YAAgC,OAAU,cAAiC;AAChF,QAAM,UAAM,qBAAsB,YAAY;AAE9C,8BAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;;;ADSe,SAAR,WACL,QACA,EAAE,eAAe,OAAO,GAAG,IAA0B,CAAC,GACf;AACvC,QAAM,sBAAkB,gCAAW,YAAY;AAC/C,QAAM,mBAAe,sBAA0B,CAAC,CAAC;AACjD,QAAM,gBAAY,gCAAW,MAAM;AACnC,QAAM,YAAsB,CAAC;AAE7B,MAAI,YAAY,MAAM,MAAM,QAAQ;AAClC,iBAAa,UAAU,CAAC;AAAA,EAC1B;AAEA,+BAAU,MAAM;AACd,iBAAa,UAAU,OAAO,OAAO,SAAS;AAAA,EAChD,CAAC;AAED,QAAM,mBAAe,gCAAW,SAAS;AAEzC,aAAO;AAAA,IACL,CAAC,UAAwB;AACvB,YAAM,EAAE,SAASC,cAAa,IAAI;AAClC,YAAM,EAAE,SAASC,QAAO,IAAI;AAC5B,YAAM,EAAE,SAASC,WAAU,IAAI;AAE/B,aAAqB,OAAO;AAAA,QAC1B,MAAM,IAAO,UAAQ;AACnB,gBAAM,WAAWA,WAAU,KAAK,WAASF,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAGjF,cAAI,UAAU;AACZ,mBAAO,SAAS,CAAC;AAAA,UACnB;AAEA,gBAAM,WAAW,aAAa,QAAQ,KAAK,WAASA,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAC5F,gBAAM,SAAS,WAAW,SAAS,CAAC,IAAIC,QAAO,KAAK,OAAO,MAAM,IAAI,KAAK;AAE1E,UAAAC,WAAU,KAAK,CAAC,MAAM,MAAM,CAAC;AAE7B,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,cAAc,WAAW,YAAY;AAAA,EACzD;AACF;","names":["import_react","itemEquality","mapper","thisCalls"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useMemoMap.ts","../src/private/usePrevious.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useRefFrom } from 'use-ref-from';\n\nimport usePrevious from './private/usePrevious';\n\ntype UseMemoMapOptions<T> = {\n itemEquality?: (this: readonly T[], x: T, y: T) => boolean;\n};\n\n/**\n * Creates a memoized mapping function.\n *\n * Unlike `React.useMemo`, the mapping function can be called multiple times in a single render loop.\n * All calls to the mapping function will be memoized.\n *\n * The memoized arguments and return values will survive next render.\n *\n * When the mapping function change, all memoized values will be invalidated.\n */\nexport default function useMemoMap<T = unknown, R = unknown>(\n mapper: (this: readonly T[], item: T, index: -1, array: readonly T[]) => R,\n { itemEquality = Object.is }: UseMemoMapOptions<T> = {}\n): (array: readonly T[]) => readonly R[] {\n const itemEqualityRef = useRefFrom(itemEquality);\n const lastCallsRef = useRef<readonly [T, R][]>([]);\n const mapperRef = useRefFrom(mapper);\n const thisCalls: [T, R][] = [];\n\n if (usePrevious(mapper) !== mapper) {\n lastCallsRef.current = [];\n }\n\n useEffect(() => {\n lastCallsRef.current = Object.freeze(thisCalls);\n });\n\n const thisCallsRef = useRefFrom(thisCalls);\n\n return useCallback<(array: readonly T[]) => readonly R[]>(\n (array: readonly T[]) => {\n const { current: itemEquality } = itemEqualityRef;\n const { current: mapper } = mapperRef;\n const { current: thisCalls } = thisCallsRef;\n\n return <readonly R[]>Object.freeze(\n array.map<R>(item => {\n const thisCall = thisCalls.find(entry => itemEquality.call(array, item, entry[0]));\n\n // If this call has memoized in the current render loop, use the memoized return value.\n if (thisCall) {\n return thisCall[1];\n }\n\n const lastCall = lastCallsRef.current.find(entry => itemEquality.call(array, item, entry[0]));\n const result = lastCall ? lastCall[1] : mapper.call(array, item, -1, array);\n\n thisCalls.push([item, result]);\n\n return result;\n })\n );\n },\n [itemEqualityRef, lastCallsRef, mapperRef, thisCallsRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T, initialValue?: T): T | undefined {\n const ref = useRef<T | undefined>(initialValue);\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";AAAA,SAAS,aAAa,aAAAA,YAAW,UAAAC,eAAc;AAC/C,SAAS,kBAAkB;;;ACD3B,SAAS,WAAW,cAAc;AAEnB,SAAR,YAAgC,OAAU,cAAiC;AAChF,QAAM,MAAM,OAAsB,YAAY;AAE9C,YAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;;;ADSe,SAAR,WACL,QACA,EAAE,eAAe,OAAO,GAAG,IAA0B,CAAC,GACf;AACvC,QAAM,kBAAkB,WAAW,YAAY;AAC/C,QAAM,eAAeC,QAA0B,CAAC,CAAC;AACjD,QAAM,YAAY,WAAW,MAAM;AACnC,QAAM,YAAsB,CAAC;AAE7B,MAAI,YAAY,MAAM,MAAM,QAAQ;AAClC,iBAAa,UAAU,CAAC;AAAA,EAC1B;AAEA,EAAAC,WAAU,MAAM;AACd,iBAAa,UAAU,OAAO,OAAO,SAAS;AAAA,EAChD,CAAC;AAED,QAAM,eAAe,WAAW,SAAS;AAEzC,SAAO;AAAA,IACL,CAAC,UAAwB;AACvB,YAAM,EAAE,SAASC,cAAa,IAAI;AAClC,YAAM,EAAE,SAASC,QAAO,IAAI;AAC5B,YAAM,EAAE,SAASC,WAAU,IAAI;AAE/B,aAAqB,OAAO;AAAA,QAC1B,MAAM,IAAO,UAAQ;AACnB,gBAAM,WAAWA,WAAU,KAAK,WAASF,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAGjF,cAAI,UAAU;AACZ,mBAAO,SAAS,CAAC;AAAA,UACnB;AAEA,gBAAM,WAAW,aAAa,QAAQ,KAAK,WAASA,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAC5F,gBAAM,SAAS,WAAW,SAAS,CAAC,IAAIC,QAAO,KAAK,OAAO,MAAM,IAAI,KAAK;AAE1E,UAAAC,WAAU,KAAK,CAAC,MAAM,MAAM,CAAC;AAE7B,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,cAAc,WAAW,YAAY;AAAA,EACzD;AACF;","names":["useEffect","useRef","useRef","useEffect","itemEquality","mapper","thisCalls"]}
1
+ {"version":3,"sources":["../src/useMemoMap.ts","../src/private/usePrevious.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useRefFrom } from 'use-ref-from';\n\nimport usePrevious from './private/usePrevious.ts';\n\ntype UseMemoMapOptions<T> = {\n itemEquality?: (this: readonly T[], x: T, y: T) => boolean;\n};\n\n/**\n * Creates a memoized mapping function.\n *\n * Unlike `React.useMemo`, the mapping function can be called multiple times in a single render loop.\n * All calls to the mapping function will be memoized.\n *\n * The memoized arguments and return values will survive next render.\n *\n * When the mapping function change, all memoized values will be invalidated.\n */\nexport default function useMemoMap<T = unknown, R = unknown>(\n mapper: (this: readonly T[], item: T, index: -1, array: readonly T[]) => R,\n { itemEquality = Object.is }: UseMemoMapOptions<T> = {}\n): (array: readonly T[]) => readonly R[] {\n const itemEqualityRef = useRefFrom(itemEquality);\n const lastCallsRef = useRef<readonly [T, R][]>([]);\n const mapperRef = useRefFrom(mapper);\n const thisCalls: [T, R][] = [];\n\n if (usePrevious(mapper) !== mapper) {\n lastCallsRef.current = [];\n }\n\n useEffect(() => {\n lastCallsRef.current = Object.freeze(thisCalls);\n });\n\n const thisCallsRef = useRefFrom(thisCalls);\n\n return useCallback<(array: readonly T[]) => readonly R[]>(\n (array: readonly T[]) => {\n const { current: itemEquality } = itemEqualityRef;\n const { current: mapper } = mapperRef;\n const { current: thisCalls } = thisCallsRef;\n\n return <readonly R[]>Object.freeze(\n array.map<R>(item => {\n const thisCall = thisCalls.find(entry => itemEquality.call(array, item, entry[0]));\n\n // If this call has memoized in the current render loop, use the memoized return value.\n if (thisCall) {\n return thisCall[1];\n }\n\n const lastCall = lastCallsRef.current.find(entry => itemEquality.call(array, item, entry[0]));\n const result = lastCall ? lastCall[1] : mapper.call(array, item, -1, array);\n\n thisCalls.push([item, result]);\n\n return result;\n })\n );\n },\n [itemEqualityRef, lastCallsRef, mapperRef, thisCallsRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T, initialValue?: T): T | undefined {\n const ref = useRef<T | undefined>(initialValue);\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";AAAA,SAAS,aAAa,aAAAA,YAAW,UAAAC,eAAc;AAC/C,SAAS,kBAAkB;;;ACD3B,SAAS,WAAW,cAAc;AAEnB,SAAR,YAAgC,OAAU,cAAiC;AAChF,QAAM,MAAM,OAAsB,YAAY;AAE9C,YAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;;;ADSe,SAAR,WACL,QACA,EAAE,eAAe,OAAO,GAAG,IAA0B,CAAC,GACf;AACvC,QAAM,kBAAkB,WAAW,YAAY;AAC/C,QAAM,eAAeC,QAA0B,CAAC,CAAC;AACjD,QAAM,YAAY,WAAW,MAAM;AACnC,QAAM,YAAsB,CAAC;AAE7B,MAAI,YAAY,MAAM,MAAM,QAAQ;AAClC,iBAAa,UAAU,CAAC;AAAA,EAC1B;AAEA,EAAAC,WAAU,MAAM;AACd,iBAAa,UAAU,OAAO,OAAO,SAAS;AAAA,EAChD,CAAC;AAED,QAAM,eAAe,WAAW,SAAS;AAEzC,SAAO;AAAA,IACL,CAAC,UAAwB;AACvB,YAAM,EAAE,SAASC,cAAa,IAAI;AAClC,YAAM,EAAE,SAASC,QAAO,IAAI;AAC5B,YAAM,EAAE,SAASC,WAAU,IAAI;AAE/B,aAAqB,OAAO;AAAA,QAC1B,MAAM,IAAO,UAAQ;AACnB,gBAAM,WAAWA,WAAU,KAAK,WAASF,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAGjF,cAAI,UAAU;AACZ,mBAAO,SAAS,CAAC;AAAA,UACnB;AAEA,gBAAM,WAAW,aAAa,QAAQ,KAAK,WAASA,cAAa,KAAK,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC;AAC5F,gBAAM,SAAS,WAAW,SAAS,CAAC,IAAIC,QAAO,KAAK,OAAO,MAAM,IAAI,KAAK;AAE1E,UAAAC,WAAU,KAAK,CAAC,MAAM,MAAM,CAAC;AAE7B,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,cAAc,WAAW,YAAY;AAAA,EACzD;AACF;","names":["useEffect","useRef","useRef","useEffect","itemEquality","mapper","thisCalls"]}
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "use-memo-map",
3
- "version": "0.2.0-main.08721dd",
3
+ "version": "0.2.0-main.202512240232.6aacbf9",
4
4
  "description": "Memoizes calls to array map function similar to React.useMemo. Memoized results will survive next render.",
5
5
  "files": [
6
+ "./*.js",
6
7
  "./dist/"
7
8
  ],
8
9
  "exports": {
@@ -21,21 +22,22 @@
21
22
  "typings": "./dist/use-memo-map.d.ts",
22
23
  "scripts": {
23
24
  "build": "tsup",
24
- "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
25
- "bump:auditfix": "npm audit fix || exit 0",
25
+ "bump": "npm run bump:prod && npm run bump:dev",
26
26
  "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
27
27
  "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
28
- "precommit": "npm run precommit:eslint && npm run precommit:typescript:production && npm run precommit:typescript:test",
29
- "precommit:eslint": "eslint ./src/",
28
+ "precommit": "npm run precommit:eslint && npm run precommit:publint && npm run precommit:typescript:production && npm run precommit:typescript:test",
29
+ "precommit:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint ./src/",
30
+ "precommit:publint": "publint",
30
31
  "precommit:typescript:production": "tsc --noEmit --project ./src/tsconfig.precommit.production.json",
31
32
  "precommit:typescript:test": "tsc --noEmit --project ./src/tsconfig.precommit.test.json",
32
33
  "prepack": "cp ../../CHANGELOG.md . && cp ../../LICENSE . && cp ../../README.md .",
34
+ "start": "npm run build -- --onSuccess \"touch ../pages/package.json\" --watch",
33
35
  "switch": "cat package.json | jq --arg SWITCH_NAME $SWITCH_NAME -r '(.[\"switch:\" + $SWITCH_NAME] // {}) as $TEMPLATE | .devDependencies += ($TEMPLATE.devDependencies // {}) | .dependencies += ($TEMPLATE.dependencies // {})' | tee ./package.json.tmp && mv ./package.json.tmp ./package.json",
34
36
  "test": "jest"
35
37
  },
36
38
  "repository": {
37
39
  "type": "git",
38
- "url": "git+https://github.com/compulim/use-memo-map.git"
40
+ "url": "https://github.com/compulim/use-memo-map.git"
39
41
  },
40
42
  "keywords": [
41
43
  "react",
@@ -54,6 +56,7 @@
54
56
  "@testing-library/react": "^12",
55
57
  "@testing-library/react-hooks": "latest",
56
58
  "@types/react": "^16",
59
+ "@types/react-dom": "^16",
57
60
  "react": "16.8.0",
58
61
  "react-dom": "16.8.0"
59
62
  }
@@ -63,6 +66,7 @@
63
66
  "@testing-library/react": "^12",
64
67
  "@testing-library/react-hooks": "latest",
65
68
  "@types/react": "^17",
69
+ "@types/react-dom": "^17",
66
70
  "react": "17.0.0",
67
71
  "react-dom": "17.0.0"
68
72
  }
@@ -70,32 +74,36 @@
70
74
  "switch:react-18": {
71
75
  "devDependencies": {
72
76
  "@types/react": "^18",
77
+ "@types/react-dom": "^18",
73
78
  "react": "18.0.0",
74
79
  "react-dom": "18.0.0"
75
80
  }
76
81
  },
77
82
  "devDependencies": {
78
- "@babel/preset-env": "^7.24.6",
79
- "@babel/preset-react": "^7.24.6",
80
- "@babel/preset-typescript": "^7.24.6",
81
- "@testing-library/react": "^15.0.7",
82
- "@tsconfig/recommended": "^1.0.6",
83
+ "@babel/preset-env": "^7.25.8",
84
+ "@babel/preset-react": "^7.25.7",
85
+ "@babel/preset-typescript": "^7.25.7",
86
+ "@testing-library/dom": "^10.4.0",
87
+ "@testing-library/react": "^16.0.1",
88
+ "@tsconfig/recommended": "^1.0.7",
83
89
  "@tsconfig/strictest": "^2.0.5",
84
- "@types/jest": "^29.5.12",
85
- "@types/react": "^18.3.3",
90
+ "@types/jest": "^29.5.13",
91
+ "@types/react": "^18.3.11",
92
+ "@types/react-dom": "^18.3.2",
86
93
  "escape-string-regexp": "^5.0.0",
87
94
  "jest": "^29.7.0",
88
95
  "jest-environment-jsdom": "^29.7.0",
96
+ "publint": "^0.2.11",
89
97
  "react": "^18.3.1",
90
98
  "react-dom": "^18.3.1",
91
- "tsup": "^8.0.2",
92
- "typescript": "^5.4.5"
99
+ "tsup": "^8.3.0",
100
+ "typescript": "^5.6.3"
93
101
  },
94
102
  "peerDependencies": {
95
103
  "react": ">=16.8.0"
96
104
  },
97
105
  "dependencies": {
98
- "use-memo-map": "^0.2.0-main.08721dd",
106
+ "use-memo-map": "^0.2.0-main.202512240232.6aacbf9",
99
107
  "use-ref-from": "^0.1.0"
100
108
  }
101
109
  }