/home2/dakshskx/test.dakshadesign.com/node_modules/express-validator/lib
NameSizeModeActions
chain/-0755rm
context-items/-0755rm
middlewares/-0755rm
base.d.ts56210644editdlrm
base.js3000644editdlrm
context-builder.d.ts5660644editdlrm
context-builder.js10480644editdlrm
context.d.ts18630644editdlrm
context.js39520644editdlrm
express-validator.d.ts78320644editdlrm
express-validator.js59280644editdlrm
field-selection.d.ts10340644editdlrm
field-selection.js76210644editdlrm
index.d.ts6770644editdlrm
index.js11330644editdlrm
matched-data.d.ts9230644editdlrm
matched-data.js18440644editdlrm
options.d.ts136300644editdlrm
options.js770644editdlrm
utils.d.ts6880644editdlrm
utils.js18370644editdlrm
validation-result.d.ts22380644editdlrm
validation-result.js25310644editdlrm
Edit: /home2/dakshskx/test.dakshadesign.com/node_modules/express-validator/lib/validation-result.d.ts (2238B)
import { Request, ValidationError } from './base'; /** * Given a validation error, returns a new value that represents it. */ export declare type ErrorFormatter = (error: ValidationError) => T; declare type ToArrayOptions = { /** * Whether only the first error of each field should be returned. * @default false */ onlyFirstError?: boolean; }; export declare type ResultFactory = (req: Request) => Result; interface ResultFactoryBuilderOptions { /** * The default error formatter of every {@link Result} instance returned by * the custom `validationResult()` function. */ formatter: ErrorFormatter; } /** * Extracts the validation errors of an express request */ export declare const validationResult: ResultFactory & { withDefaults: typeof withDefaults; }; /** * The current state of the validation errors in a request. */ export declare class Result { private formatter; private readonly errors; constructor(formatter: ErrorFormatter, errors: readonly ValidationError[]); /** * Gets the validation errors as an array. * * @param options.onlyFirstError whether only the first error of each */ array(options?: ToArrayOptions): T[]; /** * Gets the validation errors as an object. * If a field has more than one error, only the first one is set in the resulting object. * * @returns an object from field name to error */ mapped(): Record; /** * Specifies a function to format errors with. * @param formatter the function to use for formatting errors * @returns A new {@link Result} instance with the given formatter */ formatWith(formatter: ErrorFormatter): Result; /** * @returns `true` if there are no errors, `false` otherwise */ isEmpty(): boolean; /** * Throws an error if there are validation errors. */ throw(): void; } /** * Creates a `validationResult`-like function with default options passed to every {@link Result} it * returns. */ declare function withDefaults(options?: Partial>): ResultFactory; export {};