zod#OK TypeScript Examples
The following examples show how to use
zod#OK.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: upload-schema.ts From express-zod-api with MIT License | 6 votes |
_parse(input: ParseInput): ParseReturnType<UploadedFile> {
const { ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.object || !isUploadedFile(ctx.data)) {
addIssueToContext(ctx, {
code: ZodIssueCode.custom,
message: `Expected file upload, received ${ctx.parsedType}`,
});
return INVALID;
}
return OK(ctx.data);
}