Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Parse a `Content-Type` header. This will return an object with the following pro

- `type`: The media type (always lower case). Example: `'image/svg+xml'`.
- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`.
- `index`: The index where parsing stopped. Example: `33`.
- `index`: The index of the delimiter where parsing stopped, or the string length if the entire header was consumed. Example: `28`.

The parser is lenient and does not validate or throw on malformed input.

Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ export function format(obj: Partial<ContentType>): string {
*/
export interface ParseOptions {
/**
* Exit early on the first semicolon, returning only the type.
* This is useful for parsing the MIME from `Content-Type` headers.
* Whether to parse parameters after the media type. Set to `false` to exit
* early on the first semicolon, returning only the type.
*
* @default false
* @default true
*/
parameters?: boolean;
/**
Expand Down
Loading