Patch Changes
-
#4273
a8b0ddb
Thanks @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
507d546
Thanks @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
a8b0ddb
Thanks @gcanti! - Schema: Extend Support for Array filters, closes #4269.Added support for
minItems
,maxItems
, anditemsCount
to all schemas whereA
extendsReadonlyArray
, includingNonEmptyArray
.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: CorrectBigInt
andBigIntFromNumber
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 theIssue
definition fromplatform/HttpApiError
toSchema
(renamed asArrayFormatterIssue
). -
#4266
1fcbe55
Thanks @gcanti! - Schema: Replace theTimeZoneFromSelf
interface with a class definition and fix the arbitraries forDateTimeUtcFromSelf
andDateTimeZonedFromSelf
(fc.date({ noInvalidDate: true })
). -
#4279
d9a63d9
Thanks @tim-smart! - improve performance of Effect.forkIn