A
arktype•5mo ago
Bert

String length

equivalent to z.string().min(1)?
8 Replies
TizzySaurus
TizzySaurus•5mo ago
type("string>0") or type("string").atLeastLength(1)
Bert
BertOP•5mo ago
Ah thanks
TizzySaurus
TizzySaurus•5mo ago
Docs are still a WIP, but you may find this page useful: https://arktype.io/reference/cheat-sheet/
ArkType
API cheat sheet
TypeScript's 1:1 validator, optimized from editor to runtime
Bert
BertOP•5mo ago
I think I tried "1<=string" and got an error about this only being valid for numbers, so figured I couldn't do it like that. And did see that page but I don't think it says for strings.
TizzySaurus
TizzySaurus•5mo ago
It sort of does
No description
ssalbdivad
ssalbdivad•5mo ago
Is this the error you got? 😛
No description
Bert
BertOP•5mo ago
I really don't know, maybe I was being dumb
ssalbdivad
ssalbdivad•5mo ago
I mean the docs could definitely be better, but the type-level errors for that kind of thing are also super specific so should help
Want results from more Discord servers?
Add your server