UNPKG

altheia-async-data-validator

Version:

A very simple, fast and customizable async data validator

15 lines (14 loc) 710 B
import { TestFunction, ValidatorInternalTest, ValidatorInternalTestResult, ValidatorTestResult } from '../types/tests'; /** * Return a test default object * @param {string} options.name The name of the test * @param {function} options.func The function to call * @param {object} options.args The arguments to pass to the function * @return {object} The final test object */ export declare function createTest({ type, func, args, }: { type: string; func?: TestFunction; args?: any; }): ValidatorInternalTest; export declare function createTestResult(test: ValidatorInternalTest, valid: boolean, result?: ValidatorInternalTestResult): ValidatorTestResult;