Skip to content

Commit 640b53a

Browse files
committed
More cleanup for annotations
1 parent 2869a4d commit 640b53a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

annotations/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const interpret = ({ ast, schemaUri }, instance, outputFormat = BASIC) =>
3030
if (!node.annotations[keyword]) {
3131
node.annotations[keyword] = [];
3232
}
33-
node.annotations[keyword].push(annotation.annotation);
33+
node.annotations[keyword].unshift(annotation.annotation);
3434
}
3535

3636
return instance;

lib/keywords/validation.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,14 @@ const interpret = (url, instance, { ast, dynamicAnchors, errors, annotations, ou
8787
} else {
8888
const annotation = keywordHandler.annotation?.(keywordValue, instance);
8989
if (annotation !== undefined) {
90-
schemaAnnotations.unshift({
90+
schemaAnnotations.push({
9191
keyword: keywordId,
9292
absoluteKeywordLocation: schemaUri,
9393
instanceLocation: Instance.uri(instance),
9494
annotation: annotation
9595
});
9696
}
97-
for (const contextAnnotation of context.annotations) {
98-
schemaAnnotations.unshift(contextAnnotation);
99-
}
97+
schemaAnnotations.push(...context.annotations);
10098
}
10199
break;
102100
case DETAILED: {

0 commit comments

Comments
 (0)