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 1
1
# jsonld ChangeLog
2
2
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
+
3
8
## 8.1.0 - 2022-08-29
4
9
5
10
### Fixed
Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ async function _expandObject({
614
614
const ve = _expandIri ( typeScopedContext , v ,
615
615
{ base : true , vocab : true } ,
616
616
{ ...options , typeExpansion : true } ) ;
617
- if ( ! _isAbsoluteIri ( ve ) ) {
617
+ if ( ve !== '@json' && ! _isAbsoluteIri ( ve ) ) {
618
618
if ( options . eventHandler ) {
619
619
_handleEvent ( {
620
620
event : {
Original file line number Diff line number Diff line change @@ -1507,6 +1507,48 @@ _:b0 <ex:p> "v" .
1507
1507
} ) ;
1508
1508
} ) ;
1509
1509
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
+
1510
1552
it ( 'should count empty top-level object' , async ( ) => {
1511
1553
const input = { } ;
1512
1554
const expected = [ ] ;
You can’t perform that action at this time.
0 commit comments