@@ -305,7 +305,12 @@ type ProcessedProperty =
305305
306306type ProcessedType =
307307 | { type : 'complete' ; entry : MappingEntry & { typeName : string } ; ops : Array < Op > }
308- | { type : 'deferred' ; schemaType : SchemaType ; properties : Array < PropertyIdMapping > ; relations : Array < PropertyIdMapping > } ;
308+ | {
309+ type : 'deferred' ;
310+ schemaType : SchemaType ;
311+ properties : Array < PropertyIdMapping > ;
312+ relations : Array < PropertyIdMapping > ;
313+ } ;
309314
310315// Helper function to build property map from PropertyIdMappings
311316function buildPropertyMap ( properties : Array < PropertyIdMapping > ) : MappingEntry [ 'properties' ] {
@@ -392,7 +397,7 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType
392397 const primitiveProperties = pipe (
393398 resolvedProperties ,
394399 EffectArray . filter ( ( p ) => {
395- const originalProp = type . properties . find ( prop => prop . name === p . mapping . propName ) ;
400+ const originalProp = type . properties . find ( ( prop ) => prop . name === p . mapping . propName ) ;
396401 return originalProp ? ! propertyIsRelation ( originalProp ) : false ;
397402 } ) ,
398403 EffectArray . map ( ( p ) => p . mapping ) ,
@@ -401,7 +406,7 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType
401406 const relationProperties = pipe (
402407 resolvedProperties ,
403408 EffectArray . filter ( ( p ) => {
404- const originalProp = type . properties . find ( prop => prop . name === p . mapping . propName ) ;
409+ const originalProp = type . properties . find ( ( prop ) => prop . name === p . mapping . propName ) ;
405410 return originalProp ? propertyIsRelation ( originalProp ) : false ;
406411 } ) ,
407412 EffectArray . map ( ( p ) => p . mapping ) ,
@@ -418,15 +423,15 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType
418423 typeName : toPascalCase ( type . name ) ,
419424 typeIds : [ Grc20Id . Id ( type . knowledgeGraphId ) ] ,
420425 } ;
421-
426+
422427 if ( EffectArray . isNonEmptyArray ( primitiveProperties ) ) {
423428 entry . properties = buildPropertyMap ( primitiveProperties ) ;
424429 }
425-
430+
426431 if ( EffectArray . isNonEmptyArray ( relationProperties ) ) {
427432 entry . relations = buildRelationMap ( relationProperties ) ;
428433 }
429-
434+
430435 return {
431436 type : 'complete' ,
432437 entry,
@@ -460,11 +465,11 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType
460465 typeName : toPascalCase ( type . name ) ,
461466 typeIds : [ id ] ,
462467 } ;
463-
468+
464469 if ( EffectArray . isNonEmptyArray ( primitiveProperties ) ) {
465470 entry . properties = buildPropertyMap ( primitiveProperties ) ;
466471 }
467-
472+
468473 if ( EffectArray . isNonEmptyArray ( relationProperties ) ) {
469474 entry . relations = buildRelationMap ( relationProperties ) ;
470475 }
@@ -690,20 +695,17 @@ export function generateMapping(input: Schema): GenerateMappingResult {
690695 typeName : toPascalCase ( deferred . schemaType . name ) ,
691696 typeIds : [ id ] ,
692697 } ;
693-
698+
694699 if ( EffectArray . isNonEmptyArray ( deferred . properties ) ) {
695700 entry . properties = buildPropertyMap ( deferred . properties ) ;
696701 }
697-
702+
698703 if ( EffectArray . isNonEmptyArray ( allRelations ) ) {
699704 entry . relations = buildRelationMap ( allRelations ) ;
700705 }
701706
702707 return {
703- entries : [
704- ...acc . entries ,
705- entry ,
706- ] ,
708+ entries : [ ...acc . entries , entry ] ,
707709 ops : [ ...acc . ops , ...allOps ] ,
708710 } ;
709711 } ,
0 commit comments