Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010527
validator.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
492 B
Referenced Files
None
Subscribers
None
validator.ts
View Options
import
{
BaseContext
}
from
"koa"
;
import
{
Field
}
from
"sealious"
;
import
{
FieldParsedValue
}
from
".."
;
import
{
FormFieldValidationFn
}
from
"./field"
;
export
function
collectionFieldValidator
<
F
extends
Field
>
(
field
:
F
)
:
FormFieldValidationFn
<
FieldParsedValue
<
F
>>
{
return
async
(
ctx
:
BaseContext
,
value
)
=>
{
const
{
valid
,
reason
}
=
await
field
.
checkValue
(
ctx
.
$context
,
value
,
undefined
);
return
{
valid
,
message
:
reason
||
(
valid
?
"Wrong value"
:
""
)
};
};
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:43 (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
674556
Default Alt Text
validator.ts (492 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment