Variable recordValidatorsConst

recordValidators: {
    record<K, V>(keyValidator: Validator<K, unknown>, valueValidator: Validator<V, unknown>): Validator<Record<K, V>, object>;
} = ...

Type declaration

  • record:function
    • Returns a validator that asserts that the object's own enumerable properties has keys and values that match their respective validators.

      Prototype members are not included. Numeric keys are validated as strings. For example the object { [0]: 1 } will be passed to the key validator as '0'.

      Type Parameters

      • K extends string | symbol
      • V

      Parameters

      • keyValidator: Validator<K, unknown>

        Validates each key.

      • valueValidator: Validator<V, unknown>

        Validates each value.

      Returns Validator<Record<K, V>, object>