Handling empty strings with `NumberFromString` schema in Effect Typescript library

Is there a way to let "" fallback to NaN with the NumberFromString schema? eg.

      amount: S.NumberFromString.pipe(
        // some way to not error when we get ""? I'd like to fallback to something else
        S.int(local.annotate("Amount must be a whole number")),
        S.positive(local.annotate("Item must cost at least $0.01")),
        S.lessThan(100_000, local.annotate("Item must not exceed $100,000")),
      ),
Was this page helpful?