Files
signoz/frontend/src/pages/SignUp/utils.ts
2022-12-26 16:02:18 +05:30

14 lines
416 B
TypeScript

/**
* @function
* @description to check whether password is valid or not
* @reference stackoverflow.com/a/69807687
* @returns Boolean
*/
export const isPasswordValid = (value: string): boolean => {
// eslint-disable-next-line prefer-regex-literals
const pattern = new RegExp('^.{8,}$');
return pattern.test(value);
};
export const isPasswordNotValidMessage = `Password must a have minimum of 8 characters`;