Skip to content

Commit 96144f7

Browse files
committed
Fixed compact t0111 test.
1 parent ed4918a commit 96144f7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# jsonld ChangeLog
22

3+
### Fixed
4+
- compact t0111 test: "Keyword-like relative IRIs"
5+
36
### Changed
47
- Change EARL Assertor to Digital Bazaar, Inc.
58
- Update eslint dependencies.

lib/compact.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const {
3434
} = require('./url');
3535

3636
const {
37+
REGEX_KEYWORD,
3738
addValue: _addValue,
3839
asArray: _asArray,
3940
compareShortestLeast: _compareShortestLeast
@@ -927,7 +928,8 @@ api.compactIri = ({
927928
// The None case preserves rval as potentially relative
928929
return iri;
929930
} else {
930-
return _removeBase(_prependBase(base, activeCtx['@base']), iri);
931+
const _iri = _removeBase(_prependBase(base, activeCtx['@base']), iri);
932+
return REGEX_KEYWORD.test(_iri) ? `./${_iri}` : _iri;
931933
}
932934
} else {
933935
return _removeBase(base, iri);

tests/test-common.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const TEST_TYPES = {
3535
// NOTE: idRegex format:
3636
//MMM-manifest#tNNN$/,
3737
idRegex: [
38-
/compact-manifest#t0111$/,
3938
/compact-manifest#t0112$/,
4039
/compact-manifest#t0113$/,
4140
// html

0 commit comments

Comments
 (0)