Function transform

      • Create a new Schema by transforming the input and output of an existing Schema using the provided mapping functions.

        Type Parameters

        • C

        • D

        • B

        Parameters

        • to: Schema<C, D>
        • decode: ((b, options, ast) => C)
        • encode: ((c, options, ast) => B)

        Returns (<A>(self) => Schema<A, D>)

        Since

        1.0.0

      • Create a new Schema by transforming the input and output of an existing Schema using the provided mapping functions.

        Type Parameters

        • C

        • D

        • B

        Parameters

        • to: Schema<C, D>
        • decode: ((b, options, ast) => unknown)
            • (b, options, ast): unknown
            • Parameters

              Returns unknown

        • encode: ((c, options, ast) => unknown)
            • (c, options, ast): unknown
            • Parameters

              Returns unknown

        • options: {
              strict: false;
          }
          • strict: false

        Returns (<A>(self) => Schema<A, D>)

        Since

        1.0.0

      • Create a new Schema by transforming the input and output of an existing Schema using the provided mapping functions.

        Type Parameters

        • A

        • B

        • C

        • D

        Parameters

        • from: Schema<A, B>
        • to: Schema<C, D>
        • decode: ((b, options, ast) => C)
        • encode: ((c, options, ast) => B)

        Returns Schema<A, D>

        Since

        1.0.0

      • Create a new Schema by transforming the input and output of an existing Schema using the provided mapping functions.

        Type Parameters

        • A

        • B

        • C

        • D

        Parameters

        • from: Schema<A, B>
        • to: Schema<C, D>
        • decode: ((b, options, ast) => unknown)
            • (b, options, ast): unknown
            • Parameters

              Returns unknown

        • encode: ((c, options, ast) => unknown)
            • (c, options, ast): unknown
            • Parameters

              Returns unknown

        • options: {
              strict: false;
          }
          • strict: false

        Returns Schema<A, D>

        Since

        1.0.0