mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-16 12:49:56 +03:00
6 lines
228 B
TypeScript
6 lines
228 B
TypeScript
const pathLengthRegex = /^[^.]{0,108}$/
|
|
const pathPatternRegex = /^([a-zA-Z0-9_][a-zA-Z0-9/_-]*[a-zA-Z0-9_])$/
|
|
|
|
export default function isPath(path: string) {
|
|
return pathLengthRegex.test(path) && pathPatternRegex.test(path);
|
|
} |