Repository navigation
Replies: 1 comment
|
I can still reproduce A workaround is to keep the original scope and use its import { scope } from "arktype"
const definitions = scope({
record: {
"[string]": "value"
},
value: "boolean | record"
})
const $ = definitions.export()
const inputType = definitions.type({
input: $.value
})
$.value.assert({ input: true })
inputType.assert({ input: { nested: false } })Within that same scope, I checked both forms with ArkType 2.2.8 and TypeScript 5.9.3 ( |
Uh oh!
There was an error while loading. Please reload this page.
Merely mentioning a recursive type in
type()seems to break runtime:I guess the workaround would be to use
scope()instead oftype()and mentioning all dependencies manually, but it is not very convenient and the runtime breakage I am observing is a bit befuddling.What am I doing wrong?
All reactions