Skip to content

Commit c18d4c9

Browse files
authored
Check for getClientTSTypeRefCount in addV3ClientRequires (#309)
1 parent 135b8ab commit c18d4c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/transforms/v2-to-v3/modules/addV3ClientRequires.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Collection, JSCodeshift } from "jscodeshift";
33
import { getV3ClientTypeNames } from "../ts-type";
44
import { addV3ClientDefaultRequire } from "./addV3ClientDefaultRequire";
55
import { addV3ClientNamedRequire } from "./addV3ClientNamedRequire";
6+
import { getClientTSTypeRefCount } from "./getClientTSTypeRefCount";
67
import { getNewExpressionCount } from "./getNewExpressionCount";
78
import { V3ClientModulesOptions } from "./types";
89

@@ -23,7 +24,10 @@ export const addV3ClientRequires = (
2324
addV3ClientDefaultRequire(j, source, options);
2425
}
2526

26-
if (getNewExpressionCount(j, source, options) > 0) {
27+
if (
28+
getNewExpressionCount(j, source, options) > 0 ||
29+
getClientTSTypeRefCount(j, source, options) > 0
30+
) {
2731
addV3ClientNamedRequire(j, source, options);
2832
}
2933
};

0 commit comments

Comments
 (0)