This commit is contained in:
parent
987ea74375
commit
a5337323c7
@ -88,7 +88,7 @@ export function validateStation(station: unknown): boolean {
|
|||||||
if (typeof station !== "string") {
|
if (typeof station !== "string") {
|
||||||
throw new ValidationError("Invalid input: The station name should be a string");
|
throw new ValidationError("Invalid input: The station name should be a string");
|
||||||
}
|
}
|
||||||
if (!/^[A-Za-z0-9\s&'()-]+$/.test(station)) {
|
if (!/^[A-Za-z0-9\s&'()/\-]+$/.test(station)) {
|
||||||
throw new ValidationError("Invalid input: Station name should include letters, spaces, ', '/', '-', '&' only");
|
throw new ValidationError("Invalid input: Station name should include letters, spaces, ', '/', '-', '&' only");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user