aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/validation.js
blob: 7089d7fe61321d90af49f3f2e2fe6b7836ba8162 (plain) (blame)
1
2
3
4
5
6
7
8
const validation = {
    isValidColor: (color) => /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(color),
    isValidPort: (port, required) => parseInt(port, 10) > (required ? 0 : -1) && parseInt(port, 10) <= 65565,
    isValidAddress: (address) => true // TODO
};

export default validation;