migrate orion repo into monorepo structure

This commit is contained in:
talksik
2026-02-21 08:48:34 -08:00
parent 144596fcaa
commit b5f90709de
91 changed files with 19775 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package utils
import (
"errors"
"net/mail"
"strings"
)
func NormalizeEmail(email string) (string, error) {
if email == "" {
return "", errors.New("email empty")
}
lower := strings.ToLower(email)
lower = strings.TrimSpace(lower)
parsed, err := mail.ParseAddress(lower)
if err != nil {
return "", err
}
return parsed.Address, nil
}
func IsValidEmail(email string) bool {
_, err := mail.ParseAddress(email)
return err == nil
}