Function requireValueType

  • Checks that value has the run-time type given by typeName, and returns the value for easy chaining.

    Works identically to requireType except that the compile-time type of input/output is limited to expected POD value types to help catch errors at compile time.

    Parameters

    • nameForErrorMessages: string

      the name for this value, used only for error messages.

    • value: PODRawValue

      the value to check

    • typeName: string

      the expected type

    Returns PODRawValue

    the value unmodified, for easy chaining

    Throws

    TypeError if the value does not have the expected type

Generated using TypeDoc