Make union types have their own invalid text

This commit is contained in:
Dragon Fire
2024-04-30 00:46:29 -04:00
parent b14d9d5699
commit a96dd49632
+2
View File
@@ -54,6 +54,8 @@ module.exports = class Argument {
return `It must be at least ${this.min} characters long.`;
} else if (this.max !== null && this.min === null && this.typeID === 'string') {
return `It must be at most ${this.max} characters long.`;
} else if (this.type instanceof UnionType) {
return `It must be a ${list(this.type.types, 'or')}.`;
}
return `It must be a ${this.typeID}.`;
}