Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9584215
email.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
634 B
Referenced Files
None
Subscribers
None
email.ts
View Options
import
{
Field
,
Context
}
from
"../../../main"
;
const
email
=
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
;
/** Stores an email address. Rejects values not formatted as an email address. Doesn't provide any configuration or advanced filters */
export
default
class
Email
extends
Field
{
typeName
=
"email"
;
async
isProperValue
(
context
:
Context
,
value
:
string
)
{
if
(
email
.
test
(
value
)
||
value
===
""
)
{
return
Field
.
valid
();
}
else
{
return
Field
.
invalid
(
context
.
app
.
i18n
(
"invalid_email"
,
[
value
]));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Oct 11, 12:06 (12 m, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
977466
Default Alt Text
email.ts (634 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment