UNPKG

indicative-compiler

Version:

Indicative compiler to compile parsed schema into highly optimized functions

48 lines (47 loc) 1.57 kB
/** * @module compiler/validator */ import { ValidationsRunner } from './ValidationsRunner'; import { ValidationDataRoot, CollectorContract } from '../Contracts'; /** * Wraps the [[ValidationsRunner]] and executes them based upon the length of * an array at runtime. */ export declare class ArrayWrapper { private field; private index; private childrenValidators; private dotPath; /** * The pointer to read the value of the field inside the data tip */ private pointer; /** * A boolean to know if any of the children inside the wrapper * has async validators. */ async: boolean; constructor(field: string, index: string, childrenValidators: (ValidationsRunner | ArrayWrapper)[], dotPath: string[]); /** * Returns data copy to the passed to all the children of the * array. */ private getDataCopy; /** * Executes all validations for a given index value inside the array. */ private executeValidations; /** * Same as [[ArrayWrapper.executeValidations]] but async. */ private executeAsyncValidations; /** * Execute series of validations for values inside an array */ exec(data: ValidationDataRoot, collector: CollectorContract, config: unknown, bail?: boolean): boolean; /** * Execute series of async validations for values inside an array. Same * as [[ArrayWrapper.exec]] but async. */ execAsync(data: ValidationDataRoot, collector: CollectorContract, config: unknown, bail?: boolean): Promise<boolean>; }