How to create an array of type.instanceOf?
This doesn't work:
I only get it working without an array:
3 Replies
This is working 🎉:
Maybe it's worth adding this example also to the docs? https://arktype.io/docs/objects#instanceof @ArkDavid
This isn't safe because there's no way to know at runtime what the array is supposed to include.
type.instanceOf
creates a Type like any other, meaning you can just chain the standard .array()
method off it like type.instanceOf(DocumentReference).array()
Great, thanks a lot ❤️