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({
414414 const nests = [ ] ;
415415 let unexpandedValue ;
416416
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' ;
423422
424423 for ( const key of keys ) {
425424 let value = element [ key ] ;
@@ -531,7 +530,7 @@ async function _expandObject({
531530 // capture value for later
532531 // "colliding keywords" check prevents this from being set twice
533532 unexpandedValue = value ;
534- if ( inputType === '@json' && _processingMode ( activeCtx , 1.1 ) ) {
533+ if ( isJsonType && _processingMode ( activeCtx , 1.1 ) ) {
535534 // no coercion to array, and retain all values
536535 expandedParent [ '@value' ] = value ;
537536 } else {
You can’t perform that action at this time.
0 commit comments