errors: fix usage of unset parameter
This commit is contained in:
parent
d11471260c
commit
cf1e42d359
|
@ -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}!`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user