@wpazderski/js-utils
    Preparing search index...

    Class StringExToStringExConverter<TInput, TOutput>

    Converter that converts a value of type "TInput" to a value of type "TOutput" where both types extend "string". Singleton variant can be used to convert between two opaque string types. A custom instance created with static createOneOf() method can be used to ensure that only specific string values are allowed.

    Type Parameters

    • TInput extends string = string

      The type of the input value; must extend "string".

    • TOutput extends string = string

      The type of the output value; must extend "string".

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    validValues: null | readonly string[] = null

    An array of valid values or null if all strings are allowed.

    Methods

    • Throws a ConversionError for the given value.

      Parameters

      • value: TInput

        The value that caused the conversion error.

      Returns never

      never - This function does not return; it always throws an error.

      ConversionError - An error indicating that the conversion failed.