arktype
2.2.9 · 20 Oct 2026MIT3.4M / weekRepositoryHomepagenpmAtom feed
2.2.9 is the newest release of 2.x.
In short
2 fixed
Release note
The section about arktype of a note shared by several packages.
Fix this in self-referential object types
Referencing an array of the enclosing type threw a spurious shallow resolution cycle error:
// previously threw, now parses
const Node = type({
name: "string",
"children?": "this[]"
})Parse string.date.epoch.parse input as milliseconds
The validated integer string was passed directly to new Date(), which runs the date string parser rather than reading it as a timestamp:
const parseEpoch = type("string.date.epoch.parse")
// previously 2000-01-01 local time, now 1970-01-01T00:00:00.000Z
parseEpoch("0")
// previously Invalid Date, now 2023-11-14T22:13:20.000Z
parseEpoch("1700000000000")Keep uppercase UUIDs valid in string.uuid JSON Schema
string.uuid accepted uppercase hex digits via the i flag, which JSON Schema pattern cannot carry, so the exported schema rejected uppercase UUIDs the runtime check accepted. The patterns now list both cases explicitly. Thanks to @breken-ai.
Render nested bigints correctly in error messages
Bigints inside arrays or objects were printed as quoted strings, e.g. (was ["1n","0n","1n"]). They now print as (was [1n,0n,1n]). Thanks to @chatman-media.
Release unused ids from the global registry
Repeatedly creating an equivalent type (e.g. type("string") or T.pick("a") in a loop) registered a new id for each parse that nothing could reference, so memory grew without limit. Unused ids are now removed. Thanks to @isaacwasserman.
Fix crashes on Hermes and Turbopack
Unions of objects disjoint at a key no longer throw
undefined is not a functionon Hermes (Expo, React Native), which doesn't preserveArraysubclasses throughmap.scope.moduleno longer referencesthisfrom a static arrow function, which Turbopack could compile toundefined.