@@ -1770,17 +1770,29 @@ export class AmfSerializer extends AmfHelperMixin(Object) {
1770
1770
id : sm [ '@id' ] ,
1771
1771
types : sm [ '@type' ] . map ( this [ expandKey ] . bind ( this ) ) ,
1772
1772
} ) ;
1773
- const sf = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . synthesizedField ) ] ;
1774
- if ( Array . isArray ( sf ) && sf . length ) {
1775
- result . synthesizedField = sf . map ( i => this . synthesizedField ( i ) )
1773
+ const synthesizedField = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . synthesizedField ) ] ;
1774
+ if ( Array . isArray ( synthesizedField ) && synthesizedField . length ) {
1775
+ result . synthesizedField = synthesizedField . map ( i => this . synthesizedField ( i ) ) ;
1776
1776
}
1777
1777
const lexical = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . lexical ) ] ;
1778
1778
if ( Array . isArray ( lexical ) && lexical . length ) {
1779
1779
result . lexical = lexical . map ( i => this . synthesizedField ( i ) )
1780
1780
}
1781
- const te = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . trackedElement ) ] ;
1782
- if ( Array . isArray ( te ) && te . length ) {
1783
- result . trackedElement = te . map ( i => this . synthesizedField ( i ) )
1781
+ const trackedElement = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . trackedElement ) ] ;
1782
+ if ( Array . isArray ( trackedElement ) && trackedElement . length ) {
1783
+ result . trackedElement = this . synthesizedField ( trackedElement [ 0 ] ) ;
1784
+ }
1785
+ const autoName = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . autoGeneratedName ) ] ;
1786
+ if ( Array . isArray ( autoName ) && autoName . length ) {
1787
+ result . autoGeneratedName = autoName . map ( i => this . synthesizedField ( i ) )
1788
+ }
1789
+ const jsonSchema = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . parsedJsonSchema ) ] ;
1790
+ if ( Array . isArray ( jsonSchema ) && jsonSchema . length ) {
1791
+ result . parsedJsonSchema = this . synthesizedField ( jsonSchema [ 0 ] ) ;
1792
+ }
1793
+ const declaredElement = sm [ this . _getAmfKey ( ns . aml . vocabularies . docSourceMaps . declaredElement ) ] ;
1794
+ if ( Array . isArray ( declaredElement ) && declaredElement . length ) {
1795
+ result . declaredElement = this . synthesizedField ( declaredElement [ 0 ] ) ;
1784
1796
}
1785
1797
return result ;
1786
1798
}
0 commit comments