@eggjs/typebox-validate
Version:
another validate for typescript egg projects
13 lines (12 loc) • 438 B
TypeScript
import { Context } from 'egg';
import type { Schema } from 'ajv/dist/2019.js';
export default class AjvContext extends Context {
tValidate(schema: Schema, data: unknown): boolean;
tValidateWithoutThrow(schema: Schema, data: unknown): boolean;
}
declare module 'egg' {
interface Context {
tValidate(schema: Schema, data: unknown): boolean;
tValidateWithoutThrow(schema: Schema, data: unknown): boolean;
}
}