File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 10
10
defaults to ` @id ` .
11
11
- Expanding/compacting type scoped contexts uses context before applying
12
12
new versions to look for type scopes.
13
- -
14
13
15
14
### Changed
16
15
- Default processing mode changed to json-ld-1.1. Allows a 1.1 context to be
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ api.compact = async ({
163
163
const inputCtx = activeCtx ;
164
164
165
165
// revert to previous context, if there is one,
166
- // and element is not a value object or a node reference
166
+ // and element is not a value object or a node reference
167
167
if ( ! _isValue ( element ) && ! _isSubjectReference ( element ) ) {
168
168
activeCtx = activeCtx . revertToPreviousContext ( ) ;
169
169
}
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ api.process = async ({
66
66
}
67
67
68
68
// override propagate if localCtx has `@propagate`
69
- if ( _isObject ( ctxs [ 0 ] ) && '@propagate' in ctxs [ 0 ] ) {
69
+ if ( _isObject ( ctxs [ 0 ] ) && typeof ctxs [ 0 ] [ '@propagate' ] === 'boolean' ) {
70
70
// Retrieve early, error checking done later
71
71
propagate = ctxs [ 0 ] [ '@propagate' ] ;
72
72
}
@@ -90,7 +90,7 @@ api.process = async ({
90
90
// reset to initial context
91
91
if ( ctx === null ) {
92
92
// We can't nullify if there are protected terms and we're
93
- // not processing a property term scoped context
93
+ // not allowing overrides (e.g. processing a property term scoped context)
94
94
if ( ! overrideProtected &&
95
95
Object . keys ( activeCtx . protected ) . length !== 0 ) {
96
96
const protectedMode = ( options && options . protectedMode ) || 'error' ;
@@ -259,7 +259,7 @@ api.process = async ({
259
259
}
260
260
if ( typeof value !== 'boolean' ) {
261
261
throw new JsonLdError (
262
- 'Invalid JSON-LD syntax; @propagate must be boolean valued ' ,
262
+ 'Invalid JSON-LD syntax; @propagate value must be a boolean. ' ,
263
263
'jsonld.SyntaxError' ,
264
264
{ code : 'invalid @propagate value' , context : localCtx } ) ;
265
265
}
@@ -279,7 +279,8 @@ api.process = async ({
279
279
term : key ,
280
280
defined,
281
281
options,
282
- overrideProtected} ) ;
282
+ overrideProtected
283
+ } ) ;
283
284
}
284
285
285
286
// cache result
You can’t perform that action at this time.
0 commit comments