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 = ({
52
52
fakerSchemaMappings,
53
53
onSchemaConfirmed,
54
54
} : {
55
- fakerSchemaMappings : Array < FakerSchemaMapping > ;
55
+ fakerSchemaMappings : FakerSchemaMapping [ ] ;
56
56
onSchemaConfirmed : ( isConfirmed : boolean ) => void ;
57
57
} ) => {
58
58
const [ fakerSchemaFormValues , setFakerSchemaFormValues ] =
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ type MockDataGeneratorInProgressState = {
19
19
20
20
type MockDataGeneratorCompletedState = {
21
21
status : 'completed' ;
22
- fakerSchema : Array < FakerSchemaMapping > ;
22
+ fakerSchema : FakerSchemaMapping [ ] ;
23
23
requestId : string ;
24
24
} ;
25
25
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ export interface FakerMappingGenerationStartedAction {
185
185
186
186
export interface FakerMappingGenerationCompletedAction {
187
187
type : CollectionActions . FakerMappingGenerationCompleted ;
188
- fakerSchema : Array < FakerSchemaMapping > ;
188
+ fakerSchema : FakerSchemaMapping [ ] ;
189
189
requestId : string ;
190
190
}
191
191
@@ -706,8 +706,11 @@ const validateFakerSchema = (
706
706
return fakerSchema . content . fields . map ( ( field ) => {
707
707
const { fakerMethod } = field ;
708
708
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
+ ) {
711
714
logger . log . warn (
712
715
mongoLogId ( 1_001_000_372 ) ,
713
716
'Collection' ,
You can’t perform that action at this time.
0 commit comments