File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
packages/compass-collection/src
components/mock-data-generator-modal Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ const FakerSchemaEditorContent = ({
5252 fakerSchemaMappings,
5353 onSchemaConfirmed,
5454} : {
55- fakerSchemaMappings : Array < FakerSchemaMapping > ;
55+ fakerSchemaMappings : FakerSchemaMapping [ ] ;
5656 onSchemaConfirmed : ( isConfirmed : boolean ) => void ;
5757} ) => {
5858 const [ fakerSchemaFormValues , setFakerSchemaFormValues ] =
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ type MockDataGeneratorInProgressState = {
1919
2020type MockDataGeneratorCompletedState = {
2121 status : 'completed' ;
22- fakerSchema : Array < FakerSchemaMapping > ;
22+ fakerSchema : FakerSchemaMapping [ ] ;
2323 requestId : string ;
2424} ;
2525
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ export interface FakerMappingGenerationStartedAction {
185185
186186export interface FakerMappingGenerationCompletedAction {
187187 type : CollectionActions . FakerMappingGenerationCompleted ;
188- fakerSchema : Array < FakerSchemaMapping > ;
188+ fakerSchema : FakerSchemaMapping [ ] ;
189189 requestId : string ;
190190}
191191
@@ -706,8 +706,11 @@ const validateFakerSchema = (
706706 return fakerSchema . content . fields . map ( ( field ) => {
707707 const { fakerMethod } = field ;
708708
709- const [ moduleName , methodName ] = fakerMethod . split ( '.' ) ;
710- if ( typeof ( faker as any ) [ moduleName ] ?. [ methodName ] !== 'function' ) {
709+ const [ moduleName , methodName , ...rest ] = fakerMethod . split ( '.' ) ;
710+ if (
711+ rest . length > 0 ||
712+ typeof ( faker as any ) [ moduleName ] ?. [ methodName ] !== 'function'
713+ ) {
711714 logger . log . warn (
712715 mongoLogId ( 1_001_000_372 ) ,
713716 'Collection' ,
You can’t perform that action at this time.
0 commit comments