Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Jan 28, 2024
1 parent 114d7f1 commit efe24c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ The following are examples of `item` headers:
Parsed as string

```
# Parsed as string
# Parsed an ASCII string
Header: "foo"
# A simple string, called a 'Token' in the spec
Header: foo
# A Unicode string, called a 'Display String' in the spec. They use
# percent encoding, but encode a different set of characters than
# URLs.
Header %"Frysl%C3%A2n"
# Parsed as number
Header: 5
Header: -10
Expand All @@ -84,7 +89,6 @@ Header: "Hello world"; a="5"
Header: @1686634251
```


To parse these header values, use the `parseItem`:

```typescript
Expand Down Expand Up @@ -217,6 +221,9 @@ serializeItem([5.5, new Map()]);
// Returns "hello world"
serializeItem(["hello world", new Map()]);

// Returns %"Frysl%C3%A2n"
serializeItem(["Fryslân", new Map()]);

// Returns ?1
serializeItem([true, new Map()]);

Expand Down

0 comments on commit efe24c7

Please sign in to comment.