Email refinement
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2024-09-03 23:56:00 +02:00
parent a626fc1ef4
commit e5d777dfe6
2 changed files with 13 additions and 0 deletions

12
src/Schema/Email.ts Normal file
View File

@@ -0,0 +1,12 @@
import { Schema } from "@effect/schema"
export const Email = Schema.pattern(
/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i,
{
identifier: "Email",
title: "email",
message: () => "Not an email address",
},
)

View File

@@ -1,5 +1,6 @@
export * from "./Class"
export * from "./DateTime"
export * from "./Email"
export * from "./encodedAsPrismaJsonValue"
export * from "./Kind"
export * as MobX from "./MobX"