parseDictionary

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

function ยท experimental

function parseDictionary(input: string): Dictionary

Parses a Dictionary Structured Field value.

input: string

The string to parse.

Returns

The parsed Dictionary.

Example: Usage

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

const dict = parseDictionary('profile="https://example.com"');
assertEquals(dict.has("profile"), true);

See also

Source