1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.validChars = /^[a-zA-Z0-9-_]+$/;
|
4 | exports.validCharsTeamName = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
|
5 | exports.isValidOpName = (opName) => typeof opName === 'string' && exports.validChars.test(opName);
|
6 | exports.isValidTeamName = (teamName) => typeof teamName === 'string' && exports.validCharsTeamName.test(teamName);
|
7 |
|
8 | exports.validateEmail = (email) => {
|
9 | return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email);
|
10 | };
|
11 | exports.validatePasswordFormat = (input) => {
|
12 | if (input.length < 8)
|
13 | return `❗ This password is too short, please choose a password that is at least 8 characters long`;
|
14 | return true;
|
15 | };
|
16 | exports.validateCpassword = (input, answers) => {
|
17 | if (input !== answers.password) {
|
18 | return `❗ Password doesn't match, please try again.`;
|
19 | }
|
20 | return true;
|
21 | };
|