arktypea
arktype16mo ago
errata

alternative to nesting quotes in quotes for strings?

const Target = type("'BODY' | 'FACE' | 'ARMS'")

const Entity = type({
  targets: Target.array()
})
const EntityDefn =  generic(['T', Entity])('T')
const Creature = EntityDefn({
  targets: ["'BODY'", "'FACE'"]
})

Needing to double + single quote everything feels really fiddly and clumsy, like, I feel like I don't my coworkers to see this code lest they judge me.

Is there a cleaner, alternative syntax/api?
Was this page helpful?