@@ -4,7 +4,6 @@ import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config";
4
4
import { getClientTypeNames } from "./getClientTypeNames" ;
5
5
import { getTSQualifiedNameFromClientName } from "./getTSQualifiedNameFromClientName" ;
6
6
import { getV3ClientType } from "./getV3ClientType" ;
7
- import { updateV2ClientType } from "./updateV2ClientType" ;
8
7
9
8
export interface ReplaceTSQualifiedNameOptions {
10
9
v2ClientName : string ;
@@ -45,9 +44,9 @@ export const replaceTSQualifiedName = (
45
44
( v2ClientType ) =>
46
45
isRightSectionIdentifier ( v2ClientType . node ) && ! isParentTSQualifiedName ( v2ClientType )
47
46
)
48
- . forEach ( ( v2ClientType ) => {
47
+ . replaceWith ( ( v2ClientType ) => {
49
48
const v2ClientTypeName = getRightIdentifierName ( v2ClientType . node ) ;
50
- updateV2ClientType ( j , v2ClientType , { ...clientTypeOptions , v2ClientTypeName } ) ;
49
+ return getV3ClientType ( j , { ...clientTypeOptions , v2ClientTypeName } ) ;
51
50
} ) ;
52
51
}
53
52
@@ -68,9 +67,9 @@ export const replaceTSQualifiedName = (
68
67
( v2ClientType ) =>
69
68
isRightSectionIdentifier ( v2ClientType . node ) && ! isParentTSQualifiedName ( v2ClientType )
70
69
)
71
- . forEach ( ( v2ClientType ) => {
70
+ . replaceWith ( ( v2ClientType ) => {
72
71
const v2ClientTypeName = getRightIdentifierName ( v2ClientType . node ) ;
73
- updateV2ClientType ( j , v2ClientType , { ...clientTypeOptions , v2ClientTypeName } ) ;
72
+ return getV3ClientType ( j , { ...clientTypeOptions , v2ClientTypeName } ) ;
74
73
} ) ;
75
74
76
75
// Replace type reference to client type with modules.
0 commit comments