Skip to content

Commit 00a1328

Browse files
fix jsdoc
1 parent c74bcf7 commit 00a1328

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

http/unstable_structured_fields.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
1111
*
1212
* @example Parsing a Dictionary (e.g., UCP-Agent header)
1313
* ```ts
14-
* import { parseDictionary } from "@std/http/unstable-structured-fields";
14+
* import { isItem, parseDictionary } from "@std/http/unstable-structured-fields";
1515
* import { assertEquals } from "@std/assert";
1616
*
1717
* const header = 'profile="https://example.com/profile.json"';
1818
* const dict = parseDictionary(header);
19+
* const profile = dict.get("profile");
1920
*
20-
* assertEquals(dict.get("profile")?.value, {
21-
* type: "string",
22-
* value: "https://example.com/profile.json",
23-
* });
21+
* if (profile && isItem(profile)) {
22+
* assertEquals(profile.value, {
23+
* type: "string",
24+
* value: "https://example.com/profile.json",
25+
* });
26+
* }
2427
* ```
2528
*
2629
* @example Serializing a Dictionary

0 commit comments

Comments
 (0)