cookie-dialog-monster/packages/api/src/services/validation.ts

8 lines
250 B
TypeScript
Raw Normal View History

2024-08-25 10:30:55 +00:00
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { FastifyRouteSchemaDef } from 'fastify/types/schema';
export function validatorCompiler({ schema }: FastifyRouteSchemaDef<any>) {
return (data: any) => schema.validate(data);
}