github Effect-TS/effect effect@3.12.5

Patch Changes

  • #4273 a8b0ddb Thanks @gcanti! - Arbitrary: Fix bug adjusting array constraints for schemas with fixed and rest elements

    This fix ensures that when a schema includes both fixed elements and a rest element, the constraints for the array are correctly adjusted. The adjustment now subtracts the number of values generated by the fixed elements from the overall constraints.

  • #4259 507d546 Thanks @gcanti! - Schema: improve error messages for invalid transformations

    Before

    import { Schema } from "effect"
    
    Schema.decodeUnknownSync(Schema.NumberFromString)("a")
    /*
    throws:
    ParseError: NumberFromString
    └─ Transformation process failure
       └─ Expected NumberFromString, actual "a"
    */

    After

    import { Schema } from "effect"
    
    Schema.decodeUnknownSync(Schema.NumberFromString)("a")
    /*
    throws:
    ParseError: NumberFromString
    └─ Transformation process failure
       └─ Unable to decode "a" into a number
    */
  • #4273 a8b0ddb Thanks @gcanti! - Schema: Extend Support for Array filters, closes #4269.

    Added support for minItems, maxItems, and itemsCount to all schemas where A extends ReadonlyArray, including NonEmptyArray.

    Example

    import { Schema } from "effect"
    
    // Previously, this would have caused an error
    const schema = Schema.NonEmptyArray(Schema.String).pipe(Schema.maxItems(2))
  • #4257 8db239b Thanks @gcanti! - Schema: Correct BigInt and BigIntFromNumber identifier annotations to follow naming conventions

  • #4276 84a0911 Thanks @tim-smart! - fix formatting of time zone offsets that round to 60 minutes

  • #4276 84a0911 Thanks @tim-smart! - ensure DateTimeZonedFromSelf arbitrary generates in the range supported by the time zone database

  • #4267 3179a9f Thanks @tim-smart! - ensure DateTime.Zoned produces valid dates

  • #4264 6cb9b76 Thanks @gcanti! - Relocate the Issue definition from platform/HttpApiError to Schema (renamed as ArrayFormatterIssue).

  • #4266 1fcbe55 Thanks @gcanti! - Schema: Replace the TimeZoneFromSelf interface with a class definition and fix the arbitraries for DateTimeUtcFromSelf and DateTimeZonedFromSelf (fc.date({ noInvalidDate: true })).

  • #4279 d9a63d9 Thanks @tim-smart! - improve performance of Effect.forkIn

Don't miss a new effect release

NewReleases is sending notifications on new releases.