File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -414,12 +414,11 @@ async function _expandObject({
414
414
const nests = [ ] ;
415
415
let unexpandedValue ;
416
416
417
- // Remember inputType to aid with JSON literals
418
- let inputType = element [ typeKey ] ;
419
- if ( inputType ) {
420
- inputType = _asArray ( inputType ) . slice ( - 1 ) [ 0 ] ;
421
- inputType = _expandIri ( activeCtx , inputType , { vocab : true } , options ) ;
422
- }
417
+ // Figure out if this is the type for a JSON literal
418
+ const isJsonType = element [ typeKey ] &&
419
+ _expandIri ( activeCtx ,
420
+ ( _isArray ( element [ typeKey ] ) ? element [ typeKey ] [ 0 ] : element [ typeKey ] ) ,
421
+ { vocab : true } , options ) == '@json' ;
423
422
424
423
for ( const key of keys ) {
425
424
let value = element [ key ] ;
@@ -531,7 +530,7 @@ async function _expandObject({
531
530
// capture value for later
532
531
// "colliding keywords" check prevents this from being set twice
533
532
unexpandedValue = value ;
534
- if ( inputType === '@json' && _processingMode ( activeCtx , 1.1 ) ) {
533
+ if ( isJsonType && _processingMode ( activeCtx , 1.1 ) ) {
535
534
// no coercion to array, and retain all values
536
535
expandedParent [ '@value' ] = value ;
537
536
} else {
You can’t perform that action at this time.
0 commit comments