Packages

effect

4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed

Your version

3.11.6

12 Dec 2024Where it was published

3.22.5 is the newest release of 3.x.

In short

1 new1 fixed

Security

2 advisories affect 3.11.6; 3.22.1 fixes them

Release note

Patch Changes

  • Allow the transformation created by the Class API to be annotated on all its components: the type side, the transformation itself, and the encoded side.

    Example

    import { Schema, SchemaAST } from "effect"
    
    class A extends Schema.Class<A>("A")(
      {
        a: Schema.NonEmptyString
      },
      [
        { identifier: "TypeID" }, // annotations for the type side
        { identifier: "TransformationID" }, // annotations for the the transformation itself
        { identifier: "EncodedID" } // annotations for the the encoded side
      ]
    ) {}
    
    console.log(SchemaAST.getIdentifierAnnotation(A.ast.to)) // Some("TypeID")
    console.log(SchemaAST.getIdentifierAnnotation(A.ast)) // Some("TransformationID")
    console.log(SchemaAST.getIdentifierAnnotation(A.ast.from)) // Some("EncodedID")
    
    A.make({ a: "" })
    /*
    ParseError: TypeID
    └─ ["a"]
       └─ NonEmptyString
          └─ Predicate refinement failure
             └─ Expected NonEmptyString, actual ""
    */
    
    Schema.encodeSync(A)({ a: "" })
    /*
    ParseError: TransformationID
    └─ Type side transformation failure
       └─ TypeID
          └─ ["a"]
             └─ NonEmptyString
                └─ Predicate refinement failure
                   └─ Expected NonEmptyString, actual ""
    */
  • Rewrite the Arbitrary compiler from scratch, closes #2312

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.