What is the arktype 2 syntax for inferring classes with a private constructor?
In Arktype 1.x I was writing:
But the
Infer
import is not more available in arktype 2, so I'm wondering how to achieve it now?
Maybe the answer could be also added to the docs 🙂 https://arktype.io/docs/objects#instanceof5 Replies
Seems I'm getting a bit closer:
But this throws a conversion error:
If I cast it to unknown
then I get again back to the initial error:
Like this?
That would work
Awesome - you're a live saver! ❤️