import * as Leaf from "leaf-ts" export { Validator } from "leaf-ts" export function ValidateParam(validator: Leaf.Validator) { return function (obj: any, name: string, descriptor: TypedPropertyDescriptor) { let fn = descriptor.value descriptor.value = function (option, callback: Function) { try { validator.check(option) } catch (e) { callback(e) return } fn.call(this, option, callback) } } }