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) {
641
641
example ,
642
642
this . ns . aml . vocabularies . document . raw
643
643
) ) ;
644
- if ( raw === null || raw === undefined ) {
644
+ const rawIsNull = raw === null ;
645
+ const rawIsUndefined = raw === undefined ;
646
+ if ( rawIsNull || rawIsUndefined ) {
645
647
raw = /** @type {string } */ ( this . _getValue (
646
648
example ,
647
649
this . ns . w3 . shacl . raw
@@ -707,7 +709,7 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
707
709
example ,
708
710
this . ns . aml . vocabularies . core . description
709
711
) ) ;
710
- const hasRaw = raw !== null && raw !== undefined ;
712
+ const hasRaw = ! rawIsNull && ! rawIsUndefined ;
711
713
const result = { } ;
712
714
result . hasTitle = ! ! title ;
713
715
result . hasUnion = false ;
@@ -717,7 +719,7 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
717
719
if ( result . hasTitle ) {
718
720
result . title = title ;
719
721
}
720
- if ( opts . rawOnly && ( raw === null || raw === undefined ) ) {
722
+ if ( opts . rawOnly && ( rawIsNull || rawIsUndefined ) ) {
721
723
return undefined ;
722
724
}
723
725
if ( opts . rawOnly ) {
You can’t perform that action at this time.
0 commit comments