Converts a type to its JSON-serializable primitive form.
Primitive<T> transforms types for JSON serialization: boxed primitives
become primitives (Boolean→boolean), classes become plain objects with
methods removed, Date becomes string & Format<"date-time">, and types with
toJSON() use their return type. Native classes (except Date) and bigint
become never as they're not JSON-serializable.
Converts a type to its JSON-serializable primitive form.
Primitive<T>transforms types for JSON serialization: boxed primitives become primitives (Boolean→boolean), classes become plain objects with methods removed, Date becomesstring & Format<"date-time">, and types withtoJSON()use their return type. Native classes (except Date) and bigint becomeneveras they're not JSON-serializable.