Skip to content

Commit 6790d50

Browse files
authored
Update memoize dependency
1 parent e07179b commit 6790d50

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

lib/snapshot-manager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import zlib from 'node:zlib';
99
import cbor from 'cbor';
1010
import concordance from 'concordance';
1111
import indentString from 'indent-string';
12-
import mem from 'mem';
12+
import memoize from 'memoize';
1313
import writeFileAtomic from 'write-file-atomic';
1414

1515
import {snapshotManager as concordanceOptions} from './concordance-options.js';
@@ -395,7 +395,7 @@ class Manager {
395395
}
396396
}
397397

398-
const resolveSourceFile = mem(file => {
398+
const resolveSourceFile = memoize(file => {
399399
const sourceMap = findSourceMap(file);
400400
// Prior to Node.js 18.8.0, the value when a source map could not be found was `undefined`.
401401
// This changed to `null` in <https://github.com/nodejs/node/pull/43875>. Check both.
@@ -413,7 +413,7 @@ const resolveSourceFile = mem(file => {
413413
: payload.sources[0];
414414
});
415415

416-
export const determineSnapshotDir = mem(({file, fixedLocation, projectDir}) => {
416+
export const determineSnapshotDir = memoize(({file, fixedLocation, projectDir}) => {
417417
const testDir = path.dirname(resolveSourceFile(file));
418418
if (fixedLocation) {
419419
const relativeTestLocation = path.relative(projectDir, testDir);

package-lock.json

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"is-plain-object": "^5.0.0",
107107
"is-promise": "^4.0.0",
108108
"matcher": "^5.0.0",
109-
"mem": "^9.0.2",
109+
"memoize": "^10.0.0",
110110
"ms": "^2.1.3",
111111
"p-map": "^6.0.0",
112112
"package-config": "^5.0.0",

0 commit comments

Comments
 (0)