@dazejs/framework
Version:
Daze.js - A powerful web framework for Node.js
30 lines (23 loc) • 692 B
text/typescript
/**
* Copyright (c) 2019 zewail
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
import { ComponentType } from '../decorators/component-type';
import { Validate } from '../validate';
('validator')
export abstract class BaseValidator {
check(data: Record<string, any>) {
return new Validate(this.constructor as any).check(data);
}
make(data: Record<string, any>) {
return new Validate(this.constructor as any).make(data);
}
static check(data: Record<string, any>) {
return new Validate(this).check(data);
}
static make(data: Record<string, any>) {
return new Validate(this).make(data);
}
}