effect-ts-laws
    Preparing search index...

    Function encodeDecodeLaws

    • The Rule of Schemas from @effect/schema docs: “…when you perform both encoding and decoding operations, you should end up with the original value.”

      The reason we test both ways, I.e.: encode ∘ decode = identity anddecode ∘ encode = identity is there are fault models that would be entirely ignored if we only tested one direction. Check the schema laws self-test for one such example.

      Type Parameters

      • A

        Decoded type.

      • I

        Encoded type.

      Parameters

      • schema: Schema<A, I>

        The schema under test.

      Returns [Law<[I]>, Law<[A]>]

      The encode and decode laws for the given schema.