mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
add mqtt base, fix mixer, fix masterthermostat, dallas fails, fix mult. roomctrl.
This commit is contained in:
@@ -2,3 +2,4 @@ export { default as isHostname } from './isHostname';
|
||||
export { default as isIP } from './isIP';
|
||||
export { default as optional } from './optional';
|
||||
export { default as or } from './or';
|
||||
export { default as isPath } from './isPath';
|
||||
6
interface/src/validators/isPath.ts
Normal file
6
interface/src/validators/isPath.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user