Page MenuHomeSealhub

validator.ts
No OneTemporary

validator.ts

import { BaseContext } from "koa";
import { Field } from "sealious";
import { FormFieldValidationFn } from "./field";
export function collectionFieldValidator(field: Field): FormFieldValidationFn {
return async (ctx: BaseContext, value) => {
const { valid, reason } = await field.checkValue(ctx.$context, value, undefined);
return { valid, message: reason || (valid ? "Wrong value" : "") };
};
}

File Metadata

Mime Type
text/x-java
Expires
Sun, Nov 2, 19:50 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1030496
Default Alt Text
validator.ts (403 B)

Event Timeline