Fix REGEX to accept /
This commit is contained in:
@@ -88,7 +88,7 @@ export function validateStation(station: unknown): boolean {
|
||||
if (typeof station !== "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");
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user