diff options
Diffstat (limited to 'frontend/src/validation.js')
-rw-r--r-- | frontend/src/validation.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/src/validation.js b/frontend/src/validation.js new file mode 100644 index 0000000..8f3409f --- /dev/null +++ b/frontend/src/validation.js @@ -0,0 +1,8 @@ + +const validation = { + isValidColor: (color) => /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(color), + isValidPort: (port, required) => parseInt(port) > (required ? 0 : -1) && parseInt(port) <= 65565, + isValidAddress: (address) => true // TODO +}; + +export default validation; |