@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
15 lines (13 loc) • 455 B
TypeScript
import type { TextValidatorType, ValidationNames } from '../types';
export declare class TextValidator extends StringValidator implements TextValidatorType {
public name: ValidationNames = 'text'
constructor() {
super()
this.addRule({
name: 'text',
test: (value: string | null | undefined): value is string => typeof value === 'string',
message: 'Must be a text',
})
}
}
export declare function text(): TextValidator;