re-order alot, move to bun redis, generalized

This commit is contained in:
creations 2025-05-18 09:53:23 -04:00
parent a646607597
commit 8a9499be85
Signed by: creations
GPG key ID: 8F553AA4320FC711
51 changed files with 559 additions and 916 deletions

View file

@ -0,0 +1,18 @@
const emailRestrictions: { regex: RegExp } = {
regex: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
};
export function isValidEmail(email: string): {
valid: boolean;
error?: string;
} {
if (!email) {
return { valid: false, error: "" };
}
if (!emailRestrictions.regex.test(email)) {
return { valid: false, error: "Invalid email address" };
}
return { valid: true };
}