@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
15 lines • 610 B
TypeScript
import { NumberValidator } from './numbers';
import type { SmallintValidatorType, ValidationNames } from '../types';
// Export a function to create smallint validators
export declare function smallint(): SmallintValidator;
export declare class SmallintValidator extends NumberValidator implements SmallintValidatorType {
name: ValidationNames;
constructor();
min(min: number): this;
max(max: number): this;
length(length: number): this;
positive(): this;
negative(): this;
divisibleBy(divisor: number): this;
custom(fn: (value: number | null | undefined) => boolean, message: string): this;
}