arktypea
arktype8mo ago
GreggOD

How can "string" type be not empty?

Without having to add ">0" to all my string types is there an easy way to ensure that type of "string" cannot be empty string?

type({
  name: "string", // expect to be a value and not ""
  city: "string", // expect to be a value and not ""
  "town?": "string", // expect to be "" or undefined
})


Thanks
Was this page helpful?