Validating that a string isn't empty after trimming
Title says it all really. I want to have ArkType trim a string and then check its length, but
type("string.trim > 0")
doesn't work as the left side is a morph.2 Replies
Yeah there's a few options for this, basically you just have to ensure the length constraint applies after the pipe:
You can also try something like this if you want a reusable generic to create strings like this:
https://discord.com/channels/957797212103016458/1345272840538292307/1345491516549758986
But probably overkill for most scenarios
Ended up going with
B
and it worked, thanks a ton!