Skip to content

Commit e8e1d60

Browse files
committed
review
1 parent 0fb66fb commit e8e1d60

File tree

1 file changed

+4
-6
lines changed
  • packages/open-next/src/overrides/tagCache

1 file changed

+4
-6
lines changed

packages/open-next/src/overrides/tagCache/fs-dev.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ const tagCache: TagCache = {
3333
return revalidatedTags.length > 0 ? -1 : (lastModified ?? Date.now());
3434
},
3535
writeTags: async (newTags) => {
36+
const newTagsSet = new Set(
37+
newTags.map(({ tag, path }) => `${tag}-${path}`),
38+
);
3639
const unchangedTags = tags.filter(
37-
(tagPathMapping) =>
38-
!newTags.some(
39-
(tag) =>
40-
tag.tag === tagPathMapping.tag.S &&
41-
tag.path === tagPathMapping.path.S,
42-
),
40+
({ tag, path }) => !newTagsSet.has(`${tag.S}-${path.S}`),
4341
);
4442
tags = unchangedTags.concat(
4543
newTags.map((tag) => ({

0 commit comments

Comments
 (0)