mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-18 11:14:57 +02:00
## About the changes Add linter rules for regexp security vulnerabilities Commit1c5d54c76e
[fails due to regexp/no-super-linear-backtracking](https://github.com/Unleash/unleash/actions/runs/4668430535/jobs/8265506170#step:5:37) as reported here: https://github.com/Unleash/unleash/security/code-scanning/1 [0127d1a
](0127d1a746
) fixes the issues and warnings by running `yarn lint --fix`
21 lines
393 B
TypeScript
21 lines
393 B
TypeScript
// Email address matcher.
|
|
// eslint-disable-next-line no-useless-escape
|
|
const matcher =
|
|
/[A-Z0-9.!#$%&'*+-/=?^_{|}~]+@[A-Z0-9][A-Z0-9.!#$%&'*+-/=?^_{|}~]*\.[A-Z]{2,}$/i;
|
|
|
|
/**
|
|
* Loosely validate an email address.
|
|
*
|
|
* @param {string} string
|
|
* @return {boolean}
|
|
*/
|
|
function isEmail(value: string): boolean {
|
|
return matcher.test(value);
|
|
}
|
|
|
|
/*
|
|
* Exports.
|
|
*/
|
|
|
|
export default isEmail;
|