Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Rule

Index

Variables

Variables

Const Arr

Arr: { distinct: (fieldName: string, inputValue: unknown) => ValidationResult; excludes: (value: unknown) => ValidatorFunction; includes: (value: unknown) => ValidatorFunction; is: (fieldName: string, inputValue: unknown) => ValidationResult; length: (len: number) => ValidatorFunction; lengthMax: (len: number) => ValidatorFunction; lengthMin: (len: number) => ValidatorFunction } = ...

Type declaration

Const Cast

Cast: { boolean: (fieldName: string, inputValue: unknown) => ValidationResult; infer: (fieldName: string, inputValue: unknown) => ValidationResult; integer: (fieldName: string, inputValue: unknown) => ValidationResult; numeric: (fieldName: string, inputValue: unknown) => ValidationResult; string: (fieldName: string, inputValue: unknown) => ValidationResult } = ...

Type declaration

  • boolean: (fieldName: string, inputValue: unknown) => ValidationResult
      • Casts the input value to a boolean. Note that this assumes the value may be boolish. The strings "true", "True", "TRUE", and "1" evaluate to true, while "false", "False", "FALSE", and "0" evaluate to false.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • infer: (fieldName: string, inputValue: unknown) => ValidationResult
      • Attempt to infer the native type of a string value.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • integer: (fieldName: string, inputValue: unknown) => ValidationResult
      • Casts the input value to an integer. Fails otherwise.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • numeric: (fieldName: string, inputValue: unknown) => ValidationResult
      • Casts the input value to a number, if it is numerical. Fails otherwise.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • string: (fieldName: string, inputValue: unknown) => ValidationResult
      • Casts the input value to a string.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

Const Is

Is: { absent: (fieldName: string, inputValue: unknown) => ValidationResult; accepted: (fieldName: string, inputValue: unknown) => ValidationResult; boolean: (fieldName: string, inputValue: unknown) => ValidationResult; empty: (fieldName: string, inputValue: unknown) => ValidationResult; file: (fieldName: string, inputValue: unknown) => ValidationResult; filled: (fieldName: string, inputValue: unknown) => ValidationResult; foundIn: (values: any[]) => ValidatorFunction; integer: (fieldName: string, inputValue: unknown) => ValidationResult; notFoundIn: (values: any[]) => ValidatorFunction; numeric: (fieldName: string, inputValue: unknown) => ValidationResult; optional: (fieldName: string, inputValue: unknown) => ValidationResult; present: (fieldName: string, inputValue: unknown) => ValidationResult; prohibited: (fieldName: string, inputValue: unknown) => ValidationResult; required: (fieldName: string, inputValue: unknown) => ValidationResult; string: (fieldName: string, inputValue: unknown) => ValidationResult } = ...

Type declaration

  • absent: (fieldName: string, inputValue: unknown) => ValidationResult
  • accepted: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be some form of affirmative boolean.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • boolean: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be some form of boolean.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • empty: (fieldName: string, inputValue: unknown) => ValidationResult
  • file: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be a UniversalPath.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • filled: (fieldName: string, inputValue: unknown) => ValidationResult
  • foundIn: (values: any[]) => ValidatorFunction
      • Builds a validator function that requires the given input to be found in an array of values.

        Parameters

        • values: any[]

        Returns ValidatorFunction

  • integer: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be integer-like.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • notFoundIn: (values: any[]) => ValidatorFunction
      • Builds a validator function that requires the given input NOT to be found in an array of values.

        Parameters

        • values: any[]

        Returns ValidatorFunction

  • numeric: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the input value to be number-like.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • optional: (fieldName: string, inputValue: unknown) => ValidationResult
      • A special validator function that marks a field as optional. If the value of the field is nullish, no further validation rules will be applied. If it is non-nullish, validation will continue.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • present: (fieldName: string, inputValue: unknown) => ValidationResult
  • prohibited: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be absent or nullish.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • required: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the given input value to be present and non-nullish.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

  • string: (fieldName: string, inputValue: unknown) => ValidationResult
      • Requires the input value to be of type string.

        Parameters

        • fieldName: string
        • inputValue: unknown

        Returns ValidationResult

Const Num

Num: { atLeast: (value: number) => ValidatorFunction; atMost: (value: number) => ValidatorFunction; begins: (num: number) => ValidatorFunction; digits: (num: number) => ValidatorFunction; digitsMax: (num: number) => ValidatorFunction; digitsMin: (num: number) => ValidatorFunction; ends: (num: number) => ValidatorFunction; even: (fieldName: string, inputValue: unknown) => ValidationResult; greaterThan: (value: number) => ValidatorFunction; lessThan: (value: number) => ValidatorFunction; multipleOf: (num: number) => ValidatorFunction; odd: (fieldName: string, inputValue: unknown) => ValidationResult } = ...

Type declaration

Const Str

Str: { alpha: (fieldName: string, inputValue: unknown) => ValidationResult; alphaDash: (fieldName: string, inputValue: unknown) => ValidationResult; alphaNum: (fieldName: string, inputValue: unknown) => ValidationResult; alphaNumDashScore: (fieldName: string, inputValue: unknown) => ValidationResult; alphaScore: (fieldName: string, inputValue: unknown) => ValidationResult; begins: (substr: string) => ValidatorFunction; confirmed: (fieldName: string, inputValue: unknown, params: ValidatorFunctionParams) => ValidationResult; email: (fieldName: string, inputValue: unknown) => ValidationResult; ends: (substr: string) => ValidatorFunction; ip: (fieldName: string, inputValue: unknown) => ValidationResult; ipv4: (fieldName: string, inputValue: unknown) => ValidationResult; ipv6: (fieldName: string, inputValue: unknown) => ValidationResult; json: (fieldName: string, inputValue: unknown) => ValidationResult; length: (len: number) => ValidatorFunction; lengthMax: (len: number) => ValidatorFunction; lengthMin: (len: number) => ValidatorFunction; mime: (fieldName: string, inputValue: unknown) => ValidationResult; notRegex: (rex: RegExp) => ValidatorFunction; regex: (rex: RegExp) => ValidatorFunction; url: (fieldName: string, inputValue: unknown) => ValidationResult; uuid: (fieldName: string, inputValue: unknown) => ValidationResult } = ...

Type declaration

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.