• Validates the state of a map.

    The returned validator throws an exception immediately if a validation fails. This exception is then converted into an AssertionError. Exceptions unrelated to validation failures are not converted.

    Type Parameters

    • T extends undefined | null | Map<K, V>

      the type the value

    • K

      the type of keys in the map

    • V

      the type of values in the map

    Parameters

    • value: T

      the value

    • Optionalname: string

      the name of the value

    Returns MapValidator<T, K, V>

    validator for the value

    TypeError if name is undefined or null

    RangeError if name is empty