In CDDL the concept of non empty arrays exits via Type [+text] will produce an array with at least one text element.
In TypeScript this behavior is achieved with the following example:
type NonEmptyStringArray = [string, ...string[]]
const array: NonEmptyStringArray = ['string'];
In Zod this can be done by using the following chain:
In CDDL the concept of non empty arrays exits via
Type [+text]
will produce an array with at least one text element. In TypeScript this behavior is achieved with the following example:In Zod this can be done by using the following chain: