@@ -688,10 +688,9 @@ export function entityDoUpdate<T extends EditorEntity>(entity: T, sourceLine: Li
688
688
export function getFieldJsonSchema (
689
689
fieldSchema : JSONSchema7 ,
690
690
rootSchema : JSONSchema7 ,
691
- enhancement : { [ key : string ] : JSONSchema7Definition } ,
692
- requiredFilter ?: ( required : string [ ] ) => string [ ]
691
+ requiredFilter ?: ( required : string [ ] ) => string [ ] ,
692
+ enhancement : { [ key : string ] : JSONSchema7Definition } = { }
693
693
) : JSONSchema7 {
694
- const enhancementValues = enhancement ?? { } ;
695
694
let result = { ...fieldSchema } ;
696
695
if ( fieldSchema . items ) {
697
696
const itemsSchema = utils . retrieveSchema ( fieldSchema . items as JSONSchema7 , rootSchema ) ;
@@ -707,11 +706,11 @@ export function getFieldJsonSchema(
707
706
properties : {
708
707
begin : {
709
708
...( itemsSchema . properties ?. begin as JSONSchema7 ) ,
710
- ...( enhancementValues . begin as JSONSchema7 ) ,
709
+ ...( enhancement . begin as JSONSchema7 ) ,
711
710
} ,
712
711
end : {
713
712
...( itemsSchema . properties ?. end as JSONSchema7 ) ,
714
- ...( enhancementValues . end as JSONSchema7 ) ,
713
+ ...( enhancement . end as JSONSchema7 ) ,
715
714
} ,
716
715
...Object . keys ( itemsSchema . properties || { } )
717
716
. filter ( ( k ) => ! [ 'begin' , 'end' ] . includes ( k ) )
@@ -722,7 +721,7 @@ export function getFieldJsonSchema(
722
721
. reduce ( ( acc , curr ) => {
723
722
acc [ curr . name ] = {
724
723
...( curr . schema as JSONSchema7 ) ,
725
- ...( enhancementValues [ curr . name ] as JSONSchema7 ) ,
724
+ ...( enhancement [ curr . name ] as JSONSchema7 ) ,
726
725
} ;
727
726
return acc ;
728
727
} , { } as { [ key : string ] : JSONSchema7Definition } ) ,
0 commit comments