File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -641,7 +641,9 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
641641 example ,
642642 this . ns . aml . vocabularies . document . raw
643643 ) ) ;
644- if ( raw === null || raw === undefined ) {
644+ const rawIsNull = raw === null ;
645+ const rawIsUndefined = raw === undefined ;
646+ if ( rawIsNull || rawIsUndefined ) {
645647 raw = /** @type {string } */ ( this . _getValue (
646648 example ,
647649 this . ns . w3 . shacl . raw
@@ -707,7 +709,7 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
707709 example ,
708710 this . ns . aml . vocabularies . core . description
709711 ) ) ;
710- const hasRaw = raw !== null && raw !== undefined ;
712+ const hasRaw = ! rawIsNull && ! rawIsUndefined ;
711713 const result = { } ;
712714 result . hasTitle = ! ! title ;
713715 result . hasUnion = false ;
@@ -717,7 +719,7 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
717719 if ( result . hasTitle ) {
718720 result . title = title ;
719721 }
720- if ( opts . rawOnly && ( raw === null || raw === undefined ) ) {
722+ if ( opts . rawOnly && ( rawIsNull || rawIsUndefined ) ) {
721723 return undefined ;
722724 }
723725 if ( opts . rawOnly ) {
You can’t perform that action at this time.
0 commit comments