Function convert

  • Creates the shape that synchronously converts the input value.

    Type Parameters

    • Value = any

      The input value.

    • ConvertedValue = Value

      The output value.

    Parameters

    • cb: ((value, options) => ConvertedValue)

      The callback that converts the input value. Throw a ValidationError to notify that the conversion cannot be successfully completed.

        • (value, options): ConvertedValue
        • Parameters

          • value: any

            The input value.

          • options: ApplyOptions

            Parsing options.

          Returns ConvertedValue

    Returns Shape<Value, ConvertedValue>