Fix REGEX to accept /
All checks were successful
Testing / run-tests (push) Successful in 6m18s

This commit is contained in:
Fred Boniface 2025-09-08 20:36:40 +01:00
parent 987ea74375
commit a5337323c7

View File

@ -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;