arktypea
arktype11mo ago
francis

very silly question, is there an easier way to validate the length of a trimmed string?

type("string.trim > 2")

errors with Uncaught ParseError: MinLength operand must be a string or an array (was never)

type("string.trim").pipe(type("string > 3"))

appears to work, but this seems unergonomic when most other string keywords allow length specifiers. I know that this is a morph rather than a simple narrowing, but it is surprising!
Was this page helpful?