diff --git a/README.md b/README.md index 418919a..cc640c0 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/index.ts b/src/index.ts index a89b04e..b71315f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -175,10 +175,10 @@ export function format(obj: Partial): 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; /**