date
import { date } from "jsr:@ende/http/unstable-structured-fields";function ยท experimental
function date(value: Date): Extract<BareItem, { type: "date" }>Creates a date Bare Item.
value: DateThe date value. Must represent a valid date whose Unix timestamp is in the integer range; validated during serialization.
Returns
A Bare Item of type date.
Example: Usage
import { date } from "@ende/http/unstable-structured-fields";
import { assertEquals } from "@ende/assert";
const d = new Date("2022-08-04T00:00:00Z");
assertEquals(date(d), { type: "date", value: d });