Skip to content

Commit c4c3ea7

Browse files
authored
Remove v2 from remove*Module utilities (#460)
1 parent 7137519 commit c4c3ea7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export * from "./getImportSpecifiers";
44
export * from "./getRequireDeclaratorsWithProperty";
55
export * from "./getV2GlobalNameFromModule";
66
export * from "./hasRequire";
7-
export * from "./removeV2ClientModule";
8-
export * from "./removeV2GlobalModule";
7+
export * from "./removeClientModule";
8+
export * from "./removeGlobalModule";

src/transforms/v2-to-v3/modules/removeV2ClientModule.ts renamed to src/transforms/v2-to-v3/modules/removeClientModule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ import { removeRequireIdentifier } from "./removeRequireIdentifier";
1212
import { removeRequireObjectProperty } from "./removeRequireObjectProperty";
1313
import { removeRequireProperty } from "./removeRequireProperty";
1414

15-
export interface RemoveV2ClientModuleOptions {
15+
export interface RemoveClientModuleOptions {
1616
v2ClientName: string;
1717
v2ClientLocalName: string;
1818
v2GlobalName?: string;
1919
}
2020

21-
export const removeV2ClientModule = (
21+
export const removeClientModule = (
2222
j: JSCodeshift,
2323
source: Collection<unknown>,
24-
options: RemoveV2ClientModuleOptions
24+
options: RemoveClientModuleOptions
2525
) => {
2626
const { v2ClientName, v2ClientLocalName } = options;
2727
const deepImportPath = getClientDeepImportPath(v2ClientName);

src/transforms/v2-to-v3/modules/removeV2GlobalModule.ts renamed to src/transforms/v2-to-v3/modules/removeGlobalModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { removeImportDefault } from "./removeImportDefault";
77
import { removeImportEquals } from "./removeImportEquals";
88
import { removeRequireIdentifier } from "./removeRequireIdentifier";
99

10-
export const removeV2GlobalModule = (
10+
export const removeGlobalModule = (
1111
j: JSCodeshift,
1212
source: Collection<unknown>,
1313
v2GlobalName: string

src/transforms/v2-to-v3/transformer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
import {
1212
addClientModules,
1313
getV2GlobalNameFromModule,
14-
removeV2ClientModule,
15-
removeV2GlobalModule,
14+
removeClientModule,
15+
removeGlobalModule,
1616
} from "./modules";
1717
import { replaceTSTypeReference } from "./ts-type";
1818
import { isTypeScriptFile } from "./utils";
@@ -55,7 +55,7 @@ const transformer = async (file: FileInfo, api: API) => {
5555

5656
addClientModules(j, source, { ...v2Options, ...v3Options });
5757
replaceTSTypeReference(j, source, { ...v2Options, v3ClientName });
58-
removeV2ClientModule(j, source, v2Options);
58+
removeClientModule(j, source, v2Options);
5959
replaceS3UploadApi(j, source, v2Options);
6060
removePromiseCalls(j, source, v2Options);
6161
replaceWaiterApi(j, source, v2Options);
@@ -66,7 +66,7 @@ const transformer = async (file: FileInfo, api: API) => {
6666
}
6767

6868
if (v2GlobalName) {
69-
removeV2GlobalModule(j, source, v2GlobalName);
69+
removeGlobalModule(j, source, v2GlobalName);
7070
}
7171

7272
return source.toSource();

0 commit comments

Comments
 (0)