Issue with Schema.NullishOr in String Decoding

Hey everyone, I'm trying to decode a string using this schema:
const SlugSchema = Schema.String.pipe(
  Schema.minLength(5, {
    message: () => `Too short`
  }),
  Schema.maxLength(10, {
    message: () => `Too long`
  }),
  Schema.NullishOr
)

const program = Schema.decodeUnknown(SlugSchema)("test")

Effect.runPromise(program)


https://effect.website/play#6f7d3aab1605

And I'm surprised to see that when the input is "test", I still get errors from the NullishOr part in my result.

(FiberFailure) ParseError: minLength(5) & maxLength(10) | null | undefined
├─ Too short
├─ Expected null, actual "test"
└─ Expected undefined, actual "test"


Is this expected? My expectation is to only have the "Too short" error.
Was this page helpful?