errors: fix usage of unset parameter

This commit is contained in:
jkhsjdhjs 2019-11-25 15:56:03 +01:00
parent d11471260c
commit cf1e42d359
Signed by: jkhsjdhjs
GPG Key ID: BAC6ADBAB7D576CC

View File

@ -8,5 +8,5 @@ export class CookieParseError extends Error {
export function paramError(position, paramName, functionName, validTypes) { export function paramError(position, paramName, functionName, validTypes) {
validTypes = [validTypes].flatMap(t => "\"" + t + "\""); validTypes = [validTypes].flatMap(t => "\"" + t + "\"");
validTypes = validTypes.slice(0, -1).join(", ") + (validTypes.length > 1 ? " or " : "") + validTypes.slice(-1); validTypes = validTypes.slice(0, -1).join(", ") + (validTypes.length > 1 ? " or " : "") + validTypes.slice(-1);
return new TypeError(`${position} parameter "${name}" passed to "${functionName}" is not of type ${validTypes}!`); return new TypeError(`${position} parameter "${paramName}" passed to "${functionName}" is not of type ${validTypes}!`);
} }