Skip to content

Commit

Permalink
Fix @json frame test 0069.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed May 19, 2023
1 parent 6f221e9 commit fcbe90c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

### Fixed
- Improve safe mode for `@graph` use cases.
- Fix `@json` frame test 0069.

## 8.1.1 - 2023-02-25

Expand Down
5 changes: 3 additions & 2 deletions lib/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,9 @@ function _validateFrame(frame) {

if('@type' in frame[0]) {
for(const type of util.asArray(frame[0]['@type'])) {
// @id must be wildcard or an IRI
if(!(types.isObject(type) || url.isAbsolute(type)) ||
// @type must be wildcard, IRI, or @json
if(!(types.isObject(type) || url.isAbsolute(type) ||
(type === '@json')) ||
(types.isString(type) && type.indexOf('_:') === 0)) {
throw new JsonLdError(
'Invalid JSON-LD syntax; invalid @type in frame.',
Expand Down
1 change: 0 additions & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ const TEST_TYPES = {
// NOTE: idRegex format:
//MMM-manifest#tNNN$/,
idRegex: [
/frame-manifest#t0069$/,
]
},
fn: 'frame',
Expand Down

0 comments on commit fcbe90c

Please sign in to comment.