Skip to content

Commit fcd3a8f

Browse files
gkelloggdlongley
authored andcommitted
Apply suggestions fro @dlongleym code review
Co-Authored-By: Dave Longley <[email protected]>
1 parent 202cb89 commit fcd3a8f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- `@vocab` can be relative or a Compact IRI in 1.1, resolved against either a previous `@vocab`,
1414
`@base` or document base.
1515
- Better checking of absolute IRIs.
16-
- Terms that beging with a ':' are not considered absolute or compact IRIs.
16+
- Terms that beggining with a ':' are not considered absolute or compact IRIs.
1717
- Don't use terms with `@prefix`: false, or expanded term definitions to construct compact IRIs.
1818

1919
### Removed

lib/compact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,9 @@ api.compactIri = ({
827827
// If iri could be confused with a compact IRI using a term in this context,
828828
// signal an error
829829
for(const [term, td] of activeCtx.mappings) {
830-
if(iri.startsWith(term + ':') && td._prefix) {
830+
if(td._prefix && iri.startsWith(term + ':')) {
831831
throw new JsonLdError(
832-
('Absolute IRI "' + iri + '" confused with prefix "' + term + '"'),
832+
(`Absolute IRI "${iri}" confused with prefix "${term}".`),
833833
'jsonld.SyntaxError',
834834
{code: 'IRI confused with prefix', context: activeCtx});
835835
}

0 commit comments

Comments
 (0)