Comparing version 5.2.2 to 5.2.3
@@ -74,4 +74,4 @@ "use strict"; | ||
const uri = new URL(obj.$ref, scope); | ||
uri.hash = '#'; | ||
getMeta(obj).refs.add(uri.toString()); | ||
uri.hash = ''; | ||
getMeta(obj).refs.add(uri.toString() + '#'); | ||
obj[__meta].scope = normalizeUri(scope); | ||
@@ -85,11 +85,6 @@ } | ||
const id = new URL(obj.$id, scope); | ||
if (id.hash) { | ||
if (!id.hash.substr(1).match(exports.LII_RE)) { | ||
throw new SyntaxError(`Invalid identifier ${obj.$id}`); | ||
} | ||
if (id.hash && !id.hash.substr(1).match(exports.LII_RE)) { | ||
throw new SyntaxError(`Invalid identifier ${obj.$id}`); | ||
} | ||
else { | ||
id.hash = '#'; | ||
} | ||
obj[__meta].scope = id.toString(); | ||
obj[__meta].scope = normalizeUri(obj.$id, scope); | ||
obj[__meta].registry[obj[__meta].scope] = obj; | ||
@@ -96,0 +91,0 @@ obj[__meta].root = obj; |
@@ -16,4 +16,4 @@ "use strict"; | ||
const path = uri.hash ? uri.hash.substr(1) : undefined; | ||
uri.hash = '#'; | ||
out = meta.getMeta(obj).registry[uri.toString()]; | ||
uri.hash = ''; | ||
out = meta.getMeta(obj).registry[uri.toString() + '#']; | ||
if (!out) { | ||
@@ -20,0 +20,0 @@ throw new Error(`Reference not in registry (${uri.toString()})`); |
{ | ||
"name": "jsonref", | ||
"version": "5.2.2", | ||
"version": "5.2.3", | ||
"description": "Javascript References ($ref) and Pointers library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
28394
546