UNPKG

@lemoncode/fonk-range-number-validator

Version:

This is a [fonk](https://github.com/Lemoncode/fonk) microlibrary that brings validation capabilities to validate if a field of a form is in a given range

17 lines (15 loc) 517 B
import { FieldValidationFunctionSync } from '@lemoncode/fonk'; export namespace rangeNumber { export interface CustomValidatorArgs { strictTypes?: boolean; min: Limit; max: Limit; } export interface Limit { value: number; inclusive: boolean; } export const validator: FieldValidationFunctionSync<CustomValidatorArgs>; export function setErrorMessage(message: string | string[]): void; export function setCustomArgs(customArgs: Partial<CustomValidatorArgs>): void; }