string

import { string } from "jsr:@ende/http/unstable-structured-fields";

function ยท experimental

function string(value: string): Extract<BareItem, { type: "string" }>

Creates a string Bare Item.

value: string

The string value. Must contain only ASCII printable characters (0x20-0x7E); validated during serialization.

Returns

A Bare Item of type string.

Example: Usage

import { string } from "@ende/http/unstable-structured-fields";
import { assertEquals } from "@ende/assert";

assertEquals(string("hello"), { type: "string", value: "hello" });

Source