effect@3.12.5
Patch Changes
-
#4273
a8b0ddbThanks @gcanti! - Arbitrary: Fix bug adjusting array constraints for schemas with fixed and rest elementsThis 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
507d546Thanks @gcanti! - Schema: improve error messages for invalid transformationsBefore
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
a8b0ddbThanks @gcanti! - Schema: Extend Support for Array filters, closes #4269.Added support for
minItems,maxItems, anditemsCountto all schemas whereAextendsReadonlyArray, includingNonEmptyArray.Example
import { Schema } from "effect" // Previously, this would have caused an error const schema = Schema.NonEmptyArray(Schema.String).pipe(Schema.maxItems(2))
-
#4257
8db239bThanks @gcanti! - Schema: CorrectBigIntandBigIntFromNumberidentifier annotations to follow naming conventions -
#4276
84a0911Thanks @tim-smart! - fix formatting of time zone offsets that round to 60 minutes -
#4276
84a0911Thanks @tim-smart! - ensure DateTimeZonedFromSelf arbitrary generates in the range supported by the time zone database -
#4267
3179a9fThanks @tim-smart! - ensure DateTime.Zoned produces valid dates -
#4264
6cb9b76Thanks @gcanti! - Relocate theIssuedefinition fromplatform/HttpApiErrortoSchema(renamed asArrayFormatterIssue). -
#4266
1fcbe55Thanks @gcanti! - Schema: Replace theTimeZoneFromSelfinterface with a class definition and fix the arbitraries forDateTimeUtcFromSelfandDateTimeZonedFromSelf(fc.date({ noInvalidDate: true })). -
#4279
d9a63d9Thanks @tim-smart! - improve performance of Effect.forkIn