Skip to content

Commit 5900982

Browse files
committed
minor changes
1 parent 0beb3f2 commit 5900982

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/error-handlers/anyOf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ const anyOfErrorHandler = async (normalizedErrors, instance, localization) => {
106106
alternativeProperties.add(location);
107107
}
108108
}
109+
109110
return alternativeProperties;
110111
});
111112

112113
const discriminator = definedProperties.reduce((acc, properties) => {
113114
return acc.intersection(properties);
114115
}, definedProperties[0]);
115-
const discriminatedAlternatives = allAlternatives.filter((alternative) => {
116+
const discriminatedAlternatives = alternatives.filter((alternative) => {
116117
for (const instanceLocation in alternative) {
117118
if (!discriminator.has(instanceLocation)) {
118119
continue;
@@ -143,11 +144,10 @@ const anyOfErrorHandler = async (normalizedErrors, instance, localization) => {
143144
// Discriminator identified, but none of the alternatives match
144145
if (discriminatedAlternatives.length === 0) {
145146
// TODO: How do we handle this case?
146-
// errors.push(...await getErrors(allAlternatives[0], instance, localization));
147147
}
148148

149149
// Last resort, select the alternative with the most properties matching the instance
150-
// TODO: We shouldn't use this strategy if alternatives have the same number of matching instances "UPDATED"
150+
// TODO: We shouldn't use this strategy if alternatives have the same number of matching instances
151151
const instanceProperties = new Set(Instance.values(instance)
152152
.map((node) => Instance.uri(node)));
153153
let maxMatches = -1;

src/translations/en-US.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ enum-error = Unexpected value {$instanceValue}. { $variant ->
55
[types] Expected a {$expectedTypes}.
66
[values] Expected one of: ${allowedValues}.
77
[both] Expected a type of {$expectedTypes}, or one of: ${allowedValues}.
8-
[suggestion] Did you mean {$suggestion}?
8+
[suggestion] Did you mean {$suggestion}?
99
}
1010

1111
# String messages

0 commit comments

Comments
 (0)