github arktypeio/arktype arktype@2.1.16
2.1.16

latest releases: @arktype/util@0.49.0, @ark/util@0.49.0, @ark/type@2.1.22...
5 months ago
Fixed an issue causing non-serializable error config to lead to incorrect error messages in some JIT-mode cases:
const MyUnion = type('"abc" | "cde"').configure({
	message: () => "fail"
})

// old: "$ark.message"
// new: "fail"
MyUnion.assert("efg")
Added a workaround for environments where global prototypes like FormData have degenerate resolutions like {} (currently the case in @types/bun, see oven-sh/bun#18689)
const T = type("string.numeric.parse")

// previously, if a global prototype like FormData resolved to {}, it prevented
// ArkType from extracting the input/output of morphs, leading to inference like the following:

// old (with @bun/types): (In: string) => To<number>
// new (with @bun/types): number
type Parsed = typeof T.inferOut

Don't miss a new arktype release

NewReleases is sending notifications on new releases.