UNPKG

@httpc/kit

Version:

httpc toolbox for building function-based API with minimal code and end-to-end type safety

5 lines (4 loc) 303 B
import { decoratorMetadata, decoratorMiddleware } from "../controller"; import { combine } from "../di"; import { Validate } from "./pipeline"; export const validate = (...schema) => combine(decoratorMetadata("validate:paramtypes", schema.length === 0)(), decoratorMiddleware(Validate)(...schema));