arktypea
arktype2y ago
Micha

How to include an external class into an arktype type?

I tried
import { TimeStub } from 'fauna'; // class

const clientDocument = type({
    'id?': 'string',
    'coll?': 'string',
    'ts?': TimeStub
});

and
import { TimeStub } from 'fauna'; // class

const clientDocument = type({
    'id?': 'string',
    'coll?': 'string',
    'ts?': ['instanceof', TimeStub]
});

but both create a Type<never> for me.

I'm using arktype 1.0.29-alpha
Was this page helpful?