arktypea
arktype8mo ago
Bert

Modeling string template type

I have a type
type T = {
  foo: '' | `/${string}`
}

which I have modelled with arkType as
const v = type({
    foo: '"" | /^\\/.*$/',
})

Which seems like the same thing. But out infer type of foo is just
string
.

Just wondering if there is a way to model '' | `/${string}` that will give me that as an infer/out type?
Was this page helpful?