Skip to content

Commit

Permalink
avoid duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 19, 2024
1 parent fdbe8fa commit 7f1725b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { draftMode, type DangerouslyUnwrapDraftMode } from 'next/headers';

export function MyComponent2() {
draftMode().enable()
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { draftMode, type DangerouslyUnwrapDraftMode } from 'next/headers';

export function MyComponent2() {
(draftMode() as unknown as DangerouslyUnwrapDraftMode).enable()
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ function castTypesOrAddComment(
.find(j.TSTypeAliasDeclaration, {
id: { name: targetType },
})
.size() > 0 ||
importDeclaration
.find(j.ImportSpecifier, {
imported: { name: targetType },
})
.size() > 0

if (!hasImportedType) {
Expand Down

0 comments on commit 7f1725b

Please sign in to comment.