Options
All
  • Public
  • Public/Protected
  • All
Menu

This function will be called by conformDeep with the matching property value of the object being validated and the entire source object under test as its second arg.

see

conformDeep

see

ConformDeepValidator

Hierarchy

  • ConformDeepValidatorFun

Callable

  • __call(arg: any, srcConf?: object): any
  • const validator: ConformDeepValidator = {
      name: (name, srcObj) => name,
      age: (age, srcObj) => age,
      member: (member, srcObj) => !!srcObj.name === 'Bob', // Reference the source object
      owes: (owes, srcObj) => Promise.resolve(owes + 100), // Return promises or values
      valid: (valid, srcObj) => throw new Error('Sorry'), // Marks the object invalid
      some_constant: 10000 // Resulting object will always contain this value.
    }

    Parameters

    • arg: any

      The property matching value from the object being validated.

    • Optional srcConf: object

      The entire object being validated.

    Returns any

    Promise, Error, or value

Legend

  • Constructor
  • Property
  • Inherited property
  • Static property

Generated using TypeDoc