From a96dd496328b83e71600054d611e68ca8d40f914 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 30 Apr 2024 00:46:29 -0400 Subject: [PATCH] Make union types have their own invalid text --- framework/Argument.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/Argument.js b/framework/Argument.js index 034b0852..d8c80ffd 100644 --- a/framework/Argument.js +++ b/framework/Argument.js @@ -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}.`; }