Initial import of hire-me.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const EMAIL_RE =
|
||||
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
|
||||
|
||||
const IGNORE_EMAILS = new Set([
|
||||
"example@example.com",
|
||||
"email@example.com",
|
||||
"you@example.com",
|
||||
"noreply@himalayas.app",
|
||||
"hello@remotive.io",
|
||||
"hello@remotive.com",
|
||||
"nom@exemple.fr",
|
||||
]);
|
||||
|
||||
export function extractEmails(...texts: string[]): string[] {
|
||||
const found = new Set<string>();
|
||||
for (const text of texts) {
|
||||
for (const match of text.match(EMAIL_RE) ?? []) {
|
||||
const email = match.toLowerCase();
|
||||
if (IGNORE_EMAILS.has(email)) continue;
|
||||
if (email.endsWith(".png") || email.endsWith(".jpg")) continue;
|
||||
if (email.includes("exemple.") || email.includes("example.")) continue;
|
||||
found.add(email);
|
||||
}
|
||||
}
|
||||
return [...found];
|
||||
}
|
||||
Reference in New Issue
Block a user