File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 11# jsonld ChangeLog
22
3+ ## 8.1.1 - 2023-02-xx
4+
5+ ### Fixed
6+ - Don't fail in safe mode for a value object with ` "@type": "@json" ` .
7+
38## 8.1.0 - 2022-08-29
49
510### Fixed
Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ async function _expandObject({
614614 const ve = _expandIri ( typeScopedContext , v ,
615615 { base : true , vocab : true } ,
616616 { ...options , typeExpansion : true } ) ;
617- if ( ! _isAbsoluteIri ( ve ) ) {
617+ if ( ve !== '@json' && ! _isAbsoluteIri ( ve ) ) {
618618 if ( options . eventHandler ) {
619619 _handleEvent ( {
620620 event : {
Original file line number Diff line number Diff line change @@ -1507,6 +1507,48 @@ _:b0 <ex:p> "v" .
15071507 } ) ;
15081508 } ) ;
15091509
1510+ it ( 'should have zero counts with @json value' , async ( ) => {
1511+ const input =
1512+ {
1513+ "ex:p" : {
1514+ "@type" : "@json" ,
1515+ "@value" : [ null ]
1516+ }
1517+ }
1518+ ;
1519+ const expected =
1520+ [
1521+ {
1522+ "ex:p" : [
1523+ {
1524+ "@type" : "@json" ,
1525+ "@value" : [ null ]
1526+ }
1527+ ]
1528+ }
1529+ ]
1530+ ;
1531+ const nq = `\
1532+ _:b0 <ex:p> "[null]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .
1533+ `
1534+ ;
1535+
1536+ await _test ( {
1537+ type : 'expand' ,
1538+ input,
1539+ expected,
1540+ eventCounts : { } ,
1541+ testSafe : true
1542+ } ) ;
1543+ await _test ( {
1544+ type : 'toRDF' ,
1545+ input,
1546+ expected : nq ,
1547+ eventCodeLog : [ ] ,
1548+ testSafe : true
1549+ } ) ;
1550+ } ) ;
1551+
15101552 it ( 'should count empty top-level object' , async ( ) => {
15111553 const input = { } ;
15121554 const expected = [ ] ;
You can’t perform that action at this time.
0 commit comments