@@ -486,12 +486,12 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
486
486
const typeName = typeAlias . getName ( ) ;
487
487
const delegateModelNames = delegateModels . map ( ( [ delegate ] ) => delegate . name ) ;
488
488
const delegateCreateUpdateInputRegex = new RegExp (
489
- `\\ ${ delegateModelNames . join ( '|' ) } (Unchecked)?(Create|Update).*Input`
489
+ `^( ${ delegateModelNames . join ( '|' ) } ) (Unchecked)?(Create|Update).*Input$ `
490
490
) ;
491
491
if ( delegateCreateUpdateInputRegex . test ( typeName ) ) {
492
492
const toRemove = typeAlias
493
493
. getDescendantsOfKind ( SyntaxKind . PropertySignature )
494
- . filter ( ( p ) => [ 'create' , 'connectOrCreate' , 'upsert' ] . includes ( p . getName ( ) ) ) ;
494
+ . filter ( ( p ) => [ 'create' , 'createMany' , ' connectOrCreate', 'upsert' ] . includes ( p . getName ( ) ) ) ;
495
495
toRemove . forEach ( ( r ) => {
496
496
source = source . replace ( r . getText ( ) , '' ) ;
497
497
} ) ;
@@ -543,6 +543,10 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
543
543
return source ;
544
544
}
545
545
546
+ private readonly CreateUpdateWithoutDelegateRelationRegex = new RegExp (
547
+ `(.+)(Create|Update)Without${ upperCaseFirst ( DELEGATE_AUX_RELATION_PREFIX ) } _(.+)Input`
548
+ ) ;
549
+
546
550
private removeDelegateFieldsFromNestedMutationInput (
547
551
typeAlias : TypeAliasDeclaration ,
548
552
_delegateInfo : DelegateInfo ,
@@ -553,8 +557,7 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
553
557
// remove delegate model fields (and corresponding fk fields) from
554
558
// create/update input types nested inside concrete models
555
559
556
- const regex = new RegExp ( `(.+)(Create|Update)Without${ upperCaseFirst ( DELEGATE_AUX_RELATION_PREFIX ) } _(.+)Input` ) ;
557
- const match = name . match ( regex ) ;
560
+ const match = name . match ( this . CreateUpdateWithoutDelegateRelationRegex ) ;
558
561
if ( ! match ) {
559
562
return source ;
560
563
}
0 commit comments