arktypea
arktype5mo ago
Sorato

string.date.parse does not work on cyclic objects

Hello, i did not find anything related to this, but if i have a cyclic type like this:

export const types = scope({
    User: {
        "id": "number",
        "supervisor": "User"
        "createdAt": "string.date.parse"
    }
})


if i try to parse it like:

const user = types.User(data)


then only the createdAt of the user itself gets a Date, but user.supervisor.createdAt stays a string.


how can i fix this?

thanks a lot!
Was this page helpful?