@maverickcer/env-cap
    Preparing search index...

    Variable validatorsConst

    validators: {
        after: (date: Date) => Validator<Date>;
        all: <T>(...validators: Validator<T>[]) => Validator<T>;
        any: <T>(...validators: Validator<T>[]) => Validator<T>;
        before: (date: Date) => Validator<Date>;
        custom: <T>(validator: Validator<T>) => Validator<T>;
        email: () => Validator<string>;
        endsWith: (suffix: string) => Validator<string>;
        enum: <T>(allowed: readonly T[]) => Validator<T>;
        finite: () => Validator<number>;
        future: () => Validator<Date>;
        includes: (text: string) => Validator<string>;
        integer: () => Validator<number>;
        length: (expected: number) => Validator<string>;
        matches: (pattern: RegExp, message?: string) => Validator<string>;
        max: (maximum: number) => Validator<number>;
        maxItems: <T>(maximum: number) => Validator<T[]>;
        maxLength: (length: number) => Validator<string>;
        min: (minimum: number) => Validator<number>;
        minItems: <T>(minimum: number) => Validator<T[]>;
        minLength: (length: number) => Validator<string>;
        negative: () => Validator<number>;
        not: <T>(validator: Validator<T>) => Validator<T>;
        oneOf: <T>(allowed: readonly T[]) => Validator<T>;
        optional: <T>(validator: Validator<T>) => Validator<T | undefined>;
        past: () => Validator<Date>;
        positive: () => Validator<number>;
        range: (minimum: number, maximum: number) => Validator<number>;
        refine: <T>(validator: Validator<T>, message: string) => Validator<T>;
        regex: (pattern: RegExp, message?: string) => Validator<string>;
        required: (allowEmptyString?: boolean) => Validator<unknown>;
        safeInteger: () => Validator<number>;
        unique: <T>() => Validator<T[]>;
        url: () => Validator<string>;
        uuid: (versions?: readonly number[]) => Validator<string>;
        uuidVersion: (number: number) => Validator<string>;
    } = ...

    Convenience runtime.Validator implementations for common validation patterns (e.g. validators.range(1, 65535)).

    Type Declaration

    • after: (date: Date) => Validator<Date>

      Passes when the date value is strictly after date.

    • all: <T>(...validators: Validator<T>[]) => Validator<T>

      Passes only when every wrapped validator passes; returns the first failing message.

    • any: <T>(...validators: Validator<T>[]) => Validator<T>

      Passes when at least one wrapped validator passes.

    • before: (date: Date) => Validator<Date>

      Passes when the date value is strictly before date.

    • custom: <T>(validator: Validator<T>) => Validator<T>

      Identity wrapper for a hand-written Validator<T> -- no behavior change, just a fluent entry point alongside the other helpers.

    • email: () => Validator<string>

      Passes for a plausibly-shaped email address (local@domain).

    • endsWith: (suffix: string) => Validator<string>

      Passes when the string ends with suffix.

    • enum: <T>(allowed: readonly T[]) => Validator<T>

      Alias for oneOf -- passes when the value is one of the allowed values.

    • finite: () => Validator<number>

      Passes when the number is finite (rejects Infinity/-Infinity/NaN).

    • future: () => Validator<Date>

      Passes when the date is strictly after the current time.

    • includes: (text: string) => Validator<string>

      Passes when the string contains text as a substring.

    • integer: () => Validator<number>

      Passes when the number is an integer.

    • length: (expected: number) => Validator<string>

      Passes when the string's length is exactly expected.

    • matches: (pattern: RegExp, message?: string) => Validator<string>

      Passes when the string matches pattern; message overrides the default failure text.

    • max: (maximum: number) => Validator<number>

      Passes when the number is less than or equal to maximum.

    • maxItems: <T>(maximum: number) => Validator<T[]>

      Passes when the array has at most maximum items.

    • maxLength: (length: number) => Validator<string>

      Passes when the string's length is at most length.

    • min: (minimum: number) => Validator<number>

      Passes when the number is greater than or equal to minimum.

    • minItems: <T>(minimum: number) => Validator<T[]>

      Passes when the array has at least minimum items.

    • minLength: (length: number) => Validator<string>

      Passes when the string's length is at least length.

    • negative: () => Validator<number>

      Passes when the number is strictly negative.

    • not: <T>(validator: Validator<T>) => Validator<T>

      Inverts a validator: passes when the wrapped validator fails, and vice versa.

    • oneOf: <T>(allowed: readonly T[]) => Validator<T>

      Passes when the value is one of the allowed values.

    • optional: <T>(validator: Validator<T>) => Validator<T | undefined>

      Passes when the value is undefined, otherwise delegates to the provided validator.

    • past: () => Validator<Date>

      Passes when the date is strictly before the current time.

    • positive: () => Validator<number>

      Passes when the number is strictly positive.

    • range: (minimum: number, maximum: number) => Validator<number>

      Passes when the number is within [minimum, maximum] inclusive.

    • refine: <T>(validator: Validator<T>, message: string) => Validator<T>

      Runs the wrapped validator but replaces its failure message with message.

    • regex: (pattern: RegExp, message?: string) => Validator<string>

      Alias for matches -- passes when the string matches pattern.

    • required: (allowEmptyString?: boolean) => Validator<unknown>

      Passes when the value is defined and, unless allowEmptyString is set, non-empty.

    • safeInteger: () => Validator<number>

      Passes when the number is a safe integer (Number.isSafeInteger).

    • unique: <T>() => Validator<T[]>

      Passes when every item in the array is unique.

    • url: () => Validator<string>

      Passes when the string is a valid absolute URL.

    • uuid: (versions?: readonly number[]) => Validator<string>

      Passes when the string is a valid UUID of one of the given versions (default: any of 1-8).

    • uuidVersion: (number: number) => Validator<string>

      Shorthand for uuid([version]) -- passes only for that exact UUID version.