Low-level validation of a value type.

Hierarchy

Methods

  • Validates TResult value according to the specified limits.

    Returns

    The specified value if it is valid.

    Throws

    Error with explanatory message without actual value if it is invalid.

    Parameters

    • value: unknown
    • expectedType: "bigint"

    Returns bigint

  • Parameters

    • value: unknown
    • expectedType: "boolean"

    Returns boolean

  • Parameters

    • value: unknown
    • expectedType: "function"

    Returns Function

  • Parameters

    • value: unknown
    • expectedType: "number"

    Returns number

  • Parameters

    • value: unknown
    • expectedType: "object"

    Returns object

  • Parameters

    • value: unknown
    • expectedType: "string"

    Returns string

  • Parameters

    • value: unknown
    • expectedType: "symbol"

    Returns symbol

  • Parameters

    • value: unknown
    • expectedType: "undefined"

    Returns undefined

  • Parameters

    Returns unknown

Generated using TypeDoc