File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 14
14
- Terms of the form of a relative IRI may not be used as prefixes.
15
15
- Match spec error code "invalid context entry" vs "invalid context member".
16
16
- Keywords may not be used as prefixes.
17
+ - Handle term definition on ` @type ` with empty map.
17
18
18
19
### Changed
19
20
- Keep term definitions mapping to null so they may be protected.
Original file line number Diff line number Diff line change @@ -411,7 +411,8 @@ api.createTermDefinition = ({
411
411
api . processingMode ( activeCtx , 1.1 ) ) {
412
412
413
413
const validKeys = [ '@container' , '@id' , '@protected' ] ;
414
- if ( Object . keys ( value ) . some ( k => ! validKeys . includes ( k ) ) ) {
414
+ const keys = Object . keys ( value ) ;
415
+ if ( keys . length === 0 || keys . some ( k => ! validKeys . includes ( k ) ) ) {
415
416
throw new JsonLdError (
416
417
'Invalid JSON-LD syntax; keywords cannot be overridden.' ,
417
418
'jsonld.SyntaxError' ,
You can’t perform that action at this time.
0 commit comments