Skip to content

Commit

Permalink
Fix annotation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesrosiers committed May 4, 2024
1 parent 5f92eca commit 52cb464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion annotations/annotated-instance.js
Expand Up @@ -18,7 +18,7 @@ export const annotation = (node, keyword, dialect = defaultDialectId) => {
let currentNode = node.root;
const errors = Object.keys(node.root.errors);
for (let segment of JsonPointer.pointerSegments(node.pointer)) {
segment = segment === "-" && currentNode.typeOf() === "array" ? currentNode.length() : segment;
segment = segment === "-" && Instance.typeOf(currentNode) === "array" ? Instance.length(currentNode) : segment;
currentNode = Instance.step(segment, currentNode);
errors.push(...Object.keys(currentNode.errors));
}
Expand Down

0 comments on commit 52cb464

Please sign in to comment.