mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 18:39:14 +03:00
14 lines
387 B
TypeScript
14 lines
387 B
TypeScript
export function removeSlashes(string: string): string {
|
|
return string.replaceAll("/", "");
|
|
}
|
|
|
|
export function isEmail(email: string): boolean {
|
|
return new RegExp(/[a-z0-9]+@[a-z]+\.[a-z]{2,3}/).test(email);
|
|
}
|
|
|
|
export function isURL(url: string): boolean {
|
|
return new RegExp(/(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\\/~+#-]*[\w@?^=%&\\/~+#-])/).test(
|
|
url
|
|
);
|
|
}
|