@@ -4,7 +4,6 @@ import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config";
44import { getClientTypeNames } from "./getClientTypeNames" ;
55import { getTSQualifiedNameFromClientName } from "./getTSQualifiedNameFromClientName" ;
66import { getV3ClientType } from "./getV3ClientType" ;
7- import { updateV2ClientType } from "./updateV2ClientType" ;
87
98export interface ReplaceTSQualifiedNameOptions {
109 v2ClientName : string ;
@@ -45,9 +44,9 @@ export const replaceTSQualifiedName = (
4544 ( v2ClientType ) =>
4645 isRightSectionIdentifier ( v2ClientType . node ) && ! isParentTSQualifiedName ( v2ClientType )
4746 )
48- . forEach ( ( v2ClientType ) => {
47+ . replaceWith ( ( v2ClientType ) => {
4948 const v2ClientTypeName = getRightIdentifierName ( v2ClientType . node ) ;
50- updateV2ClientType ( j , v2ClientType , { ...clientTypeOptions , v2ClientTypeName } ) ;
49+ return getV3ClientType ( j , { ...clientTypeOptions , v2ClientTypeName } ) ;
5150 } ) ;
5251 }
5352
@@ -68,9 +67,9 @@ export const replaceTSQualifiedName = (
6867 ( v2ClientType ) =>
6968 isRightSectionIdentifier ( v2ClientType . node ) && ! isParentTSQualifiedName ( v2ClientType )
7069 )
71- . forEach ( ( v2ClientType ) => {
70+ . replaceWith ( ( v2ClientType ) => {
7271 const v2ClientTypeName = getRightIdentifierName ( v2ClientType . node ) ;
73- updateV2ClientType ( j , v2ClientType , { ...clientTypeOptions , v2ClientTypeName } ) ;
72+ return getV3ClientType ( j , { ...clientTypeOptions , v2ClientTypeName } ) ;
7473 } ) ;
7574
7675 // Replace type reference to client type with modules.
0 commit comments