Packages

effect

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

Your version

3.13.8

9 Mar 2025Where it was published

3.22.5 is the newest release of 3.x.

In short

2 fixed

Security

2 advisories affect 3.13.8; 3.22.1 fixes them

Release note

Patch Changes

  • Schema: standardSchemaV1 now returns all errors by default and supports custom options.

    The standardSchemaV1 now returns all validation errors by default (ParseOptions = { errors: "all" }). Additionally, it now accepts an optional overrideOptions parameter, allowing you to customize the default parsing behavior as needed.

  • ParseResult.ArrayFormatter: Correct _tag fields for Refinement and Transformation issues, closes #4564.

    This update fixes an issue where ParseResult.ArrayFormatter incorrectly labeled Refinement and Transformation errors as Type in the output.

    Before

    import { Effect, ParseResult, Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.NonEmptyString,
      b: Schema.NumberFromString
    })
    
    const input = { a: "", b: "" }
    
    const program = Schema.decodeUnknown(schema, { errors: "all" })(input).pipe(
      Effect.catchTag("ParseError", (err) =>
        ParseResult.ArrayFormatter.formatError(err).pipe(
          Effect.map((err) => JSON.stringify(err, null, 2))
        )
      )
    )
    
    program.pipe(Effect.runPromise).then(console.log)
    /*
    [
      {
        "_tag": "Type", ❌
        "path": [
          "a"
        ],
        "message": "Expected a non empty string, actual \"\""
      },
      {
        "_tag": "Type", ❌
        "path": [
          "b"
        ],
        "message": "Unable to decode \"\" into a number"
      }
    ]
    */

    After

    import { Effect, ParseResult, Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.NonEmptyString,
      b: Schema.NumberFromString
    })
    
    const input = { a: "", b: "" }
    
    const program = Schema.decodeUnknown(schema, { errors: "all" })(input).pipe(
      Effect.catchTag("ParseError", (err) =>
        ParseResult.ArrayFormatter.formatError(err).pipe(
          Effect.map((err) => JSON.stringify(err, null, 2))
        )
      )
    )
    
    program.pipe(Effect.runPromise).then(console.log)
    /*
    [
      {
        "_tag": "Refinement", ✅
        "path": [
          "a"
        ],
        "message": "Expected a non empty string, actual \"\""
      },
      {
        "_tag": "Transformation", ✅
        "path": [
          "b"
        ],
        "message": "Unable to decode \"\" into a number"
      }
    ]
    */

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.