chore(utils): clean util package deps (#4146)

This commit is contained in:
Frane Polić
2023-05-26 13:20:12 +02:00
committed by GitHub
parent f47b11293e
commit db41995307
36 changed files with 593 additions and 996 deletions
+11 -1
View File
@@ -1,6 +1,16 @@
import { isEmail } from "class-validator"
import { MedusaError } from "./errors"
const EMAIL_REGEX =
/^(([^<>()[\]\\.,;:\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,}))$/
/**
* Check whether provided string is an email.
* @param email - string to check
*/
function isEmail(email: string) {
return email.toLowerCase().match(EMAIL_REGEX)
}
/**
* Used to validate user email.
* @param {string} email - email to validate