UNPKG

argumental

Version:

Framework for building CLI apps with Node.js

24 lines (23 loc) 1.43 kB
import { Argumental } from '../types'; export declare class BuiltInValidators { /** Checks if the value is string (cannot be converted into a number or boolean). */ STRING: Argumental.Validator; /** Checks if the value is number or can be converted to number. Casts the value to number if passed. */ NUMBER: Argumental.Validator; /** Checks if the value is boolean or can be converted to boolean (accepts 'true' and 'false' for conversion). Casts the value to boolean if passed. */ BOOLEAN: Argumental.Validator; /** Checks if all values of the array are strings (cannot be converted into numbers or booleans). * <strong>Should be used on rest arguments only</strong>. */ STRINGS: Argumental.Validator; /** Checks if all values of the array are numbers or can be converted to number. Casts all values to number if passed. * <strong>Should be used on rest arguments only</strong>. */ NUMBERS: Argumental.Validator; /** Checks if all values of the array are booleans or can be converted to booleans (accepts 'true' and 'false' for conversion). Casts all values to boolean if passed. * <strong>Should be used on rest arguments only</strong>. */ BOOLEANS: Argumental.Validator; /** Checks if the value is a valid file path and the file exists and can be read (absolute or relative to current working directory). */ FILE_PATH: Argumental.Validator; }