@d1g1tal/media-type 6.0.3 → 6.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,54 @@
1
+ ## [6.0.6](https://github.com/D1g1talEntr0py/media-type/compare/v6.0.5...v6.0.6) (2026-03-18)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **release:** added --no-git-checks flag to ensure build is published (a9fe03c0a57b082207ff4dbcc1528ea27c7f78ab)
6
+
7
+ ## [6.0.5](https://github.com/D1g1talEntr0py/media-type/compare/v6.0.4...v6.0.5) (2026-03-18)
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependencies to resolve CVE-2026-32141 (c6adc5b382b3a177ce1cbe7dd19d50305256bcba)
12
+ Updates development dependencies and patches the pnpm lockfile to remediate the identified security vulnerability.
13
+
14
+ Fixes CVE-2026-32141
15
+
16
+
17
+ ### Documentation
18
+
19
+ * update license from ISC to MIT (9d7a3d00cf16ada234781a9a9bfa8aee8b4d1de3)
20
+ Transitions the overarching software license to MIT across the project text and supporting package metadata.
21
+
22
+
23
+ ### Continuous Integration
24
+
25
+ * update workflows and semantic release configuration (8a2ec6ce64ee5faa98eda3528f748de592a40294)
26
+ Bumps GitHub Actions to their latest major versions and updates semantic-release configuration to use pnpm commands for publishing.
27
+
28
+ ## [6.0.4](https://github.com/D1g1talEntr0py/media-type/compare/v6.0.3...v6.0.4) (2026-03-07)
29
+
30
+ ### Bug Fixes
31
+
32
+ * bump eslint to address security vulnerability (efc758fa369a2987b64297a09cc955ad076ce78e)
33
+ Updates eslint to 10.0.3 which includes a security fix, along with
34
+ its internal sub-packages (@eslint/core, @eslint/config-array,
35
+ @eslint/config-helpers, @eslint/object-schema, @eslint/plugin-kit,
36
+ eslint-scope, espree) to their corresponding patch releases.
37
+
38
+ Also bumps @types/node to pick up the latest type definitions.
39
+
40
+
41
+ ### Miscellaneous Chores
42
+
43
+ * replace whatwg-encoding with @exodus/bytes (14f73e922b6c0fe8cc70b28fb74434e5294586ad)
44
+ Switches the encoding label lookup dependency from the deprecated
45
+ whatwg-encoding to @exodus/bytes, which is faster and more
46
+ spec-conformant.
47
+
48
+ Updates the test code to use the new import path and adjusts the
49
+ calling convention to pass an empty string fallback, matching the
50
+ new API.
51
+
1
52
  ## [6.0.3](https://github.com/D1g1talEntr0py/media-type/compare/v6.0.2...v6.0.3) (2026-03-02)
2
53
 
3
54
  ### Bug Fixes
package/LICENSE CHANGED
@@ -1,15 +1,21 @@
1
- ISC License
1
+ MIT License
2
2
 
3
- Copyright (c) 2023, Jason DiMeo
3
+ Copyright (c) 2026 D1g1talEntr0py
4
4
 
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
8
11
 
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@d1g1tal/media-type)](https://www.npmjs.com/package/@d1g1tal/media-type)
5
5
  [![CI](https://github.com/D1g1talEntr0py/media-type/actions/workflows/ci.yml/badge.svg)](https://github.com/D1g1talEntr0py/media-type/actions/workflows/ci.yml)
6
6
  [![codecov](https://codecov.io/gh/D1g1talEntr0py/media-type/graph/badge.svg)](https://codecov.io/gh/D1g1talEntr0py/media-type)
7
- [![License: ISC](https://img.shields.io/github/license/D1g1talEntr0py/media-type?cacheSeconds=0)](https://github.com/D1g1talEntr0py/media-type/blob/main/LICENSE)
7
+ [![License: MIT](https://img.shields.io/github/license/D1g1talEntr0py/media-type)](https://github.com/D1g1talEntr0py/media-type/blob/main/LICENSE)
8
8
  [![Node.js](https://img.shields.io/node/v/@d1g1tal/media-type)](https://nodejs.org)
9
9
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
10
 
@@ -1,284 +1,3 @@
1
- // src/utils.ts
2
- var httpTokenCodePoints = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;
3
-
4
- // src/media-type-parameters.ts
5
- var matcher = /(["\\])/ug;
6
- var httpQuotedStringTokenCodePoints = /^[\t\u0020-\u007E\u0080-\u00FF]*$/u;
7
- var MediaTypeParameters = class _MediaTypeParameters extends Map {
8
- /**
9
- * Create a new MediaTypeParameters instance.
10
- *
11
- * @param entries An array of [ name, value ] tuples.
12
- */
13
- constructor(entries = []) {
14
- super(entries);
15
- }
16
- /**
17
- * Indicates whether the supplied name and value are valid media type parameters.
18
- *
19
- * @param name The name of the media type parameter to validate.
20
- * @param value The media type parameter value to validate.
21
- * @returns true if the media type parameter is valid, false otherwise.
22
- */
23
- static isValid(name, value) {
24
- return httpTokenCodePoints.test(name) && httpQuotedStringTokenCodePoints.test(value);
25
- }
26
- /**
27
- * Gets the media type parameter value for the supplied name.
28
- *
29
- * @param name The name of the media type parameter to retrieve.
30
- * @returns The media type parameter value.
31
- */
32
- get(name) {
33
- return super.get(name.toLowerCase());
34
- }
35
- /**
36
- * Indicates whether the media type parameter with the specified name exists or not.
37
- *
38
- * @param name The name of the media type parameter to check.
39
- * @returns true if the media type parameter exists, false otherwise.
40
- */
41
- has(name) {
42
- return super.has(name.toLowerCase());
43
- }
44
- /**
45
- * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.
46
- * If an parameter with the same name already exists, the parameter will be updated.
47
- *
48
- * @param name The name of the media type parameter to set.
49
- * @param value The media type parameter value.
50
- * @returns This instance.
51
- */
52
- set(name, value) {
53
- if (!_MediaTypeParameters.isValid(name, value)) {
54
- throw new Error(`Invalid media type parameter name/value: ${name}/${value}`);
55
- }
56
- super.set(name.toLowerCase(), value);
57
- return this;
58
- }
59
- /**
60
- * Removes the media type parameter using the specified name.
61
- *
62
- * @param name The name of the media type parameter to delete.
63
- * @returns true if the parameter existed and has been removed, or false if the parameter does not exist.
64
- */
65
- delete(name) {
66
- return super.delete(name.toLowerCase());
67
- }
68
- /**
69
- * Returns a string representation of the media type parameters.
70
- *
71
- * @returns The string representation of the media type parameters.
72
- */
73
- toString() {
74
- return Array.from(this).map(([name, value]) => `;${name}=${!value || !httpTokenCodePoints.test(value) ? `"${value.replace(matcher, "\\$1")}"` : value}`).join("");
75
- }
76
- /**
77
- * Returns the name of this class.
78
- *
79
- * @returns The name of this class.
80
- */
81
- get [Symbol.toStringTag]() {
82
- return "MediaTypeParameters";
83
- }
84
- };
85
-
86
- // src/media-type-parser.ts
87
- var whitespaceChars = /* @__PURE__ */ new Set([" ", " ", "\n", "\r"]);
88
- var trailingWhitespace = /[ \t\n\r]+$/u;
89
- var leadingAndTrailingWhitespace = /^[ \t\n\r]+|[ \t\n\r]+$/ug;
90
- var MediaTypeParser = class _MediaTypeParser {
91
- /**
92
- * Function to parse a media type.
93
- * @param input The media type to parse
94
- * @returns An object populated with the parsed media type properties and any parameters.
95
- */
96
- static parse(input) {
97
- input = input.replace(leadingAndTrailingWhitespace, "");
98
- let position = 0;
99
- const [type, typeEnd] = _MediaTypeParser.collect(input, position, ["/"]);
100
- position = typeEnd;
101
- if (!type.length || position >= input.length || !httpTokenCodePoints.test(type)) {
102
- throw new TypeError(_MediaTypeParser.generateErrorMessage("type", type));
103
- }
104
- ++position;
105
- const [subtype, subtypeEnd] = _MediaTypeParser.collect(input, position, [";"], true, true);
106
- position = subtypeEnd;
107
- if (!subtype.length || !httpTokenCodePoints.test(subtype)) {
108
- throw new TypeError(_MediaTypeParser.generateErrorMessage("subtype", subtype));
109
- }
110
- const parameters = new MediaTypeParameters();
111
- while (position < input.length) {
112
- ++position;
113
- while (whitespaceChars.has(input[position])) {
114
- ++position;
115
- }
116
- let name;
117
- [name, position] = _MediaTypeParser.collect(input, position, [";", "="], false);
118
- if (position >= input.length || input[position] === ";") {
119
- continue;
120
- }
121
- ++position;
122
- let value;
123
- if (input[position] === '"') {
124
- [value, position] = _MediaTypeParser.collectHttpQuotedString(input, position);
125
- while (position < input.length && input[position] !== ";") {
126
- ++position;
127
- }
128
- } else {
129
- [value, position] = _MediaTypeParser.collect(input, position, [";"], false, true);
130
- if (!value) {
131
- continue;
132
- }
133
- }
134
- if (name && MediaTypeParameters.isValid(name, value) && !parameters.has(name)) {
135
- parameters.set(name, value);
136
- }
137
- }
138
- return { type, subtype, parameters };
139
- }
140
- /**
141
- * Gets the name of this class.
142
- * @returns The string tag of this class.
143
- */
144
- get [Symbol.toStringTag]() {
145
- return "MediaTypeParser";
146
- }
147
- /**
148
- * Collects characters from `input` starting at `pos` until a stop character is found.
149
- * @param input The input string.
150
- * @param pos The starting position.
151
- * @param stopChars Characters that end collection.
152
- * @param lowerCase Whether to ASCII-lowercase the result.
153
- * @param trim Whether to strip trailing HTTP whitespace.
154
- * @returns A tuple of the collected string and the updated position.
155
- */
156
- static collect(input, pos, stopChars, lowerCase = true, trim = false) {
157
- let result = "";
158
- for (const { length } = input; pos < length && !stopChars.includes(input[pos]); pos++) {
159
- result += input[pos];
160
- }
161
- if (lowerCase) {
162
- result = result.toLowerCase();
163
- }
164
- if (trim) {
165
- result = result.replace(trailingWhitespace, "");
166
- }
167
- return [result, pos];
168
- }
169
- /**
170
- * Collects all the HTTP quoted strings.
171
- * This variant only implements it with the extract-value flag set.
172
- * @param input The string to process.
173
- * @param position The starting position.
174
- * @returns An array that includes the resulting string and updated position.
175
- */
176
- static collectHttpQuotedString(input, position) {
177
- let value = "";
178
- for (let length = input.length, char; ++position < length; ) {
179
- if ((char = input[position]) === '"') {
180
- break;
181
- }
182
- value += char == "\\" && ++position < length ? input[position] : char;
183
- }
184
- return [value, position];
185
- }
186
- /**
187
- * Generates an error message.
188
- * @param component The component name.
189
- * @param value The component value.
190
- * @returns The error message.
191
- */
192
- static generateErrorMessage(component, value) {
193
- return `Invalid ${component} "${value}": only HTTP token code points are valid.`;
194
- }
195
- };
196
-
197
- // src/media-type.ts
198
- var MediaType = class _MediaType {
199
- _type;
200
- _subtype;
201
- _parameters;
202
- /**
203
- * Create a new MediaType instance from a string representation.
204
- * @param mediaType The media type to parse.
205
- * @param parameters Optional parameters.
206
- */
207
- constructor(mediaType, parameters = {}) {
208
- if (parameters === null || typeof parameters !== "object" || Array.isArray(parameters)) {
209
- throw new TypeError("The parameters argument must be an object");
210
- }
211
- ({ type: this._type, subtype: this._subtype, parameters: this._parameters } = MediaTypeParser.parse(mediaType));
212
- for (const [name, value] of Object.entries(parameters)) {
213
- this._parameters.set(name, value);
214
- }
215
- }
216
- /**
217
- * Parses a media type string.
218
- * @param mediaType The media type to parse.
219
- * @returns The parsed media type or null if the mediaType cannot be parsed.
220
- */
221
- static parse(mediaType) {
222
- try {
223
- return new _MediaType(mediaType);
224
- } catch {
225
- }
226
- return null;
227
- }
228
- /**
229
- * Gets the type.
230
- * @returns The type.
231
- */
232
- get type() {
233
- return this._type;
234
- }
235
- /**
236
- * Gets the subtype.
237
- * @returns The subtype.
238
- */
239
- get subtype() {
240
- return this._subtype;
241
- }
242
- /**
243
- * Gets the media type essence (type/subtype).
244
- * @returns The media type without any parameters
245
- */
246
- get essence() {
247
- return `${this._type}/${this._subtype}`;
248
- }
249
- /**
250
- * Gets the parameters.
251
- * @returns The media type parameters.
252
- */
253
- get parameters() {
254
- return this._parameters;
255
- }
256
- /**
257
- * Checks if the media type matches the specified type.
258
- *
259
- * @param mediaType The media type to check.
260
- * @returns true if the media type matches the specified type, false otherwise.
261
- */
262
- matches(mediaType) {
263
- return typeof mediaType === "string" ? this.essence.includes(mediaType) : this._type === mediaType._type && this._subtype === mediaType._subtype;
264
- }
265
- /**
266
- * Gets the serialized version of the media type.
267
- *
268
- * @returns The serialized media type.
269
- */
270
- toString() {
271
- return `${this.essence}${this._parameters.toString()}`;
272
- }
273
- /**
274
- * Gets the name of the class.
275
- * @returns The class name
276
- */
277
- get [Symbol.toStringTag]() {
278
- return "MediaType";
279
- }
280
- };
281
- export {
282
- MediaType
283
- };
1
+ var o=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;var y=/(["\\])/ug,d=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,c=class r extends Map{constructor(t=[]){super(t)}static isValid(t,e){return o.test(t)&&d.test(e)}get(t){return super.get(t.toLowerCase())}has(t){return super.has(t.toLowerCase())}set(t,e){if(!r.isValid(t,e))throw new Error(`Invalid media type parameter name/value: ${t}/${e}`);return super.set(t.toLowerCase(),e),this}delete(t){return super.delete(t.toLowerCase())}toString(){return Array.from(this).map(([t,e])=>`;${t}=${!e||!o.test(e)?`"${e.replace(y,"\\$1")}"`:e}`).join("")}get[Symbol.toStringTag](){return"MediaTypeParameters"}};var m=new Set([" "," ",`
2
+ `,"\r"]),b=/[ \t\n\r]+$/u,f=/^[ \t\n\r]+|[ \t\n\r]+$/ug,u=class r{static parse(t){t=t.replace(f,"");let e=0,[s,i]=r.collect(t,e,["/"]);if(e=i,!s.length||e>=t.length||!o.test(s))throw new TypeError(r.generateErrorMessage("type",s));++e;let[n,a]=r.collect(t,e,[";"],!0,!0);if(e=a,!n.length||!o.test(n))throw new TypeError(r.generateErrorMessage("subtype",n));let g=new c;for(;e<t.length;){for(++e;m.has(t[e]);)++e;let l;if([l,e]=r.collect(t,e,[";","="],!1),e>=t.length||t[e]===";")continue;++e;let p;if(t[e]==='"')for([p,e]=r.collectHttpQuotedString(t,e);e<t.length&&t[e]!==";";)++e;else if([p,e]=r.collect(t,e,[";"],!1,!0),!p)continue;l&&c.isValid(l,p)&&!g.has(l)&&g.set(l,p)}return{type:s,subtype:n,parameters:g}}get[Symbol.toStringTag](){return"MediaTypeParser"}static collect(t,e,s,i=!0,n=!1){let a="";for(let{length:g}=t;e<g&&!s.includes(t[e]);e++)a+=t[e];return i&&(a=a.toLowerCase()),n&&(a=a.replace(b,"")),[a,e]}static collectHttpQuotedString(t,e){let s="";for(let i=t.length,n;++e<i&&(n=t[e])!=='"';)s+=n=="\\"&&++e<i?t[e]:n;return[s,e]}static generateErrorMessage(t,e){return`Invalid ${t} "${e}": only HTTP token code points are valid.`}};var h=class r{_type;_subtype;_parameters;constructor(t,e={}){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("The parameters argument must be an object");({type:this._type,subtype:this._subtype,parameters:this._parameters}=u.parse(t));for(let[s,i]of Object.entries(e))this._parameters.set(s,i)}static parse(t){try{return new r(t)}catch{}return null}get type(){return this._type}get subtype(){return this._subtype}get essence(){return`${this._type}/${this._subtype}`}get parameters(){return this._parameters}matches(t){return typeof t=="string"?this.essence.includes(t):this._type===t._type&&this._subtype===t._subtype}toString(){return`${this.essence}${this._parameters.toString()}`}get[Symbol.toStringTag](){return"MediaType"}};export{h as MediaType};
284
3
  //# sourceMappingURL=media-type.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/utils.ts", "../src/media-type-parameters.ts", "../src/media-type-parser.ts", "../src/media-type.ts"],
4
4
  "sourcesContent": ["export const httpTokenCodePoints: RegExp = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;", "import { httpTokenCodePoints } from './utils.js';\n\nconst matcher: RegExp = /([\"\\\\])/ug;\nconst httpQuotedStringTokenCodePoints: RegExp = /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u;\n\n/**\n * Class representing the parameters for a media type record.\n * This class extends a JavaScript Map<string, string>.\n *\n * However, MediaTypeParameters methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an Error.\n *\n * @see https://mimesniff.spec.whatwg.org\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParameters extends Map<string, string> {\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param entries An array of [ name, value ] tuples.\n\t */\n\tconstructor(entries: Iterable<[string, string]> = []) {\n\t\tsuper(entries);\n\t}\n\n\t/**\n\t * Indicates whether the supplied name and value are valid media type parameters.\n\t *\n\t * @param name The name of the media type parameter to validate.\n\t * @param value The media type parameter value to validate.\n\t * @returns true if the media type parameter is valid, false otherwise.\n\t */\n\tstatic isValid(name: string, value: string): boolean {\n\t\treturn httpTokenCodePoints.test(name) && httpQuotedStringTokenCodePoints.test(value);\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param name The name of the media type parameter to retrieve.\n\t * @returns The media type parameter value.\n\t */\n\toverride get(name: string): string | undefined {\n\t\treturn super.get(name.toLowerCase());\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param name The name of the media type parameter to check.\n\t * @returns true if the media type parameter exists, false otherwise.\n\t */\n\toverride has(name: string): boolean {\n\t\treturn super.has(name.toLowerCase());\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param name The name of the media type parameter to set.\n\t * @param value The media type parameter value.\n\t * @returns This instance.\n\t */\n\toverride set(name: string, value: string): this {\n\t\tif (!MediaTypeParameters.isValid(name, value)) {\n\t\t\tthrow new Error(`Invalid media type parameter name/value: ${name}/${value}`);\n\t\t}\n\n\t\tsuper.set(name.toLowerCase(), value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param name The name of the media type parameter to delete.\n\t * @returns true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\toverride delete(name: string): boolean {\n\t\treturn super.delete(name.toLowerCase());\n\t}\n\n\t/**\n\t * Returns a string representation of the media type parameters.\n\t *\n\t * @returns The string representation of the media type parameters.\n\t */\n\toverride toString(): string {\n\t\treturn Array.from(this).map(([ name, value ]) => `;${name}=${!value || !httpTokenCodePoints.test(value) ? `\"${value.replace(matcher, '\\\\$1')}\"` : value}`).join('');\n\t}\n\n\t/**\n\t * Returns the name of this class.\n\t *\n\t * @returns The name of this class.\n\t */\n\toverride get [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParameters';\n\t}\n}", "import { MediaTypeParameters } from './media-type-parameters.js';\nimport { httpTokenCodePoints } from './utils.js';\n\nconst whitespaceChars = new Set([' ', '\\t', '\\n', '\\r']);\nconst trailingWhitespace: RegExp = /[ \\t\\n\\r]+$/u;\nconst leadingAndTrailingWhitespace: RegExp = /^[ \\t\\n\\r]+|[ \\t\\n\\r]+$/ug;\n\nexport interface MediaTypeComponent {\n\tposition?: number;\n\tinput: string;\n\tlowerCase?: boolean;\n\ttrim?: boolean;\n}\n\nexport interface ParsedMediaType {\n\ttype: string;\n\tsubtype: string;\n\tparameters: MediaTypeParameters;\n}\n\n/**\n * Parser for media types.\n * @see https://mimesniff.spec.whatwg.org/#parsing-a-mime-type\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParser {\n\t/**\n\t * Function to parse a media type.\n\t * @param input The media type to parse\n\t * @returns An object populated with the parsed media type properties and any parameters.\n\t */\n\tstatic parse(input: string): ParsedMediaType {\n\t\tinput = input.replace(leadingAndTrailingWhitespace, '');\n\n\t\tlet position = 0;\n\t\tconst [ type, typeEnd ] = MediaTypeParser.collect(input, position, ['/']);\n\t\tposition = typeEnd;\n\n\t\tif (!type.length || position >= input.length || !httpTokenCodePoints.test(type)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('type', type));\n\t\t}\n\n\t\t++position; // Skip \"/\"\n\t\tconst [ subtype, subtypeEnd ] = MediaTypeParser.collect(input, position, [';'], true, true);\n\t\tposition = subtypeEnd;\n\n\t\tif (!subtype.length || !httpTokenCodePoints.test(subtype)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('subtype', subtype));\n\t\t}\n\n\t\tconst parameters = new MediaTypeParameters();\n\n\t\twhile (position < input.length) {\n\t\t\t++position; // Skip \";\"\n\t\t\twhile (whitespaceChars.has(input[position]!)) { ++position }\n\n\t\t\tlet name: string;\n\t\t\t[name, position] = MediaTypeParser.collect(input, position, [';', '='], false);\n\n\t\t\tif (position >= input.length || input[position] === ';') { continue }\n\n\t\t\t++position; // Skip \"=\"\n\n\t\t\tlet value: string;\n\t\t\tif (input[position] === '\"') {\n\t\t\t\t[ value, position ] = MediaTypeParser.collectHttpQuotedString(input, position);\n\t\t\t\twhile (position < input.length && input[position] !== ';') { ++position }\n\t\t\t} else {\n\t\t\t\t[ value, position ] = MediaTypeParser.collect(input, position, [';'], false, true);\n\t\t\t\tif (!value) { continue }\n\t\t\t}\n\n\t\t\tif (name && MediaTypeParameters.isValid(name, value) && !parameters.has(name)) {\n\t\t\t\tparameters.set(name, value);\n\t\t\t}\n\t\t}\n\n\t\treturn { type, subtype, parameters };\n\t}\n\n\t/**\n\t * Gets the name of this class.\n\t * @returns The string tag of this class.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParser';\n\t}\n\n\t/**\n\t * Collects characters from `input` starting at `pos` until a stop character is found.\n\t * @param input The input string.\n\t * @param pos The starting position.\n\t * @param stopChars Characters that end collection.\n\t * @param lowerCase Whether to ASCII-lowercase the result.\n\t * @param trim Whether to strip trailing HTTP whitespace.\n\t * @returns A tuple of the collected string and the updated position.\n\t */\n\tprivate static collect(input: string, pos: number, stopChars: string[], lowerCase = true, trim = false): [string, number] {\n\t\tlet result = '';\n\t\tfor (const { length } = input; pos < length && !stopChars.includes(input[pos]!); pos++) {\n\t\t\tresult += input[pos];\n\t\t}\n\n\t\tif (lowerCase) { result = result.toLowerCase() }\n\t\tif (trim) { result = result.replace(trailingWhitespace, '') }\n\n\t\treturn [result, pos];\n\t}\n\n\t/**\n\t * Collects all the HTTP quoted strings.\n\t * This variant only implements it with the extract-value flag set.\n\t * @param input The string to process.\n\t * @param position The starting position.\n\t * @returns An array that includes the resulting string and updated position.\n\t */\n\tprivate static collectHttpQuotedString(input: string, position: number): [string, number] {\n\t\tlet value = '';\n\n\t\tfor (let length = input.length, char; ++position < length;) {\n\t\t\tif ((char = input[position]) === '\"') { break }\n\n\t\t\tvalue += char == '\\\\' && ++position < length ? input[position] : char;\n\t\t}\n\n\t\treturn [ value, position ];\n\t}\n\n\t/**\n\t * Generates an error message.\n\t * @param component The component name.\n\t * @param value The component value.\n\t * @returns The error message.\n\t */\n\tprivate static generateErrorMessage(component: string, value: string): string {\n\t\treturn `Invalid ${component} \"${value}\": only HTTP token code points are valid.`;\n\t}\n}", "import { MediaTypeParser } from './media-type-parser.js';\nimport { MediaTypeParameters } from './media-type-parameters.js';\n\n/**\n * Class used to parse media types.\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n */\nexport class MediaType {\n\tprivate readonly _type: string;\n\tprivate readonly _subtype: string;\n\tprivate readonly _parameters: MediaTypeParameters;\n\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t * @param mediaType The media type to parse.\n\t * @param parameters Optional parameters.\n\t */\n\tconstructor(mediaType: string, parameters: Record<string, string> = {}) {\n\t\tif (parameters === null || typeof parameters !== 'object' || Array.isArray(parameters)) {\n\t\t\tthrow new TypeError('The parameters argument must be an object');\n\t\t}\n\n\t\t({ type: this._type, subtype: this._subtype, parameters: this._parameters } = MediaTypeParser.parse(mediaType));\n\n\t\tfor (const [ name, value ] of Object.entries(parameters)) { this._parameters.set(name, value) }\n\t}\n\n\t/**\n\t * Parses a media type string.\n\t * @param mediaType The media type to parse.\n\t * @returns The parsed media type or null if the mediaType cannot be parsed.\n\t */\n\tstatic parse(mediaType: string): MediaType | null {\n\t\ttry {\n\t\t\treturn new MediaType(mediaType);\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets the type.\n\t * @returns The type.\n\t */\n\tget type(): string {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t * @returns The subtype.\n\t */\n\tget subtype(): string {\n\t\treturn this._subtype;\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t * @returns The media type without any parameters\n\t */\n\tget essence(): string {\n\t\treturn `${this._type}/${this._subtype}`;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t * @returns The media type parameters.\n\t */\n\tget parameters(): MediaTypeParameters {\n\t\treturn this._parameters;\n\t}\n\n\t/**\n\t * Checks if the media type matches the specified type.\n\t *\n\t * @param mediaType The media type to check.\n\t * @returns true if the media type matches the specified type, false otherwise.\n\t */\n\tmatches(mediaType: MediaType | string): boolean {\n\t\treturn typeof mediaType === 'string' ? this.essence.includes(mediaType) : this._type === mediaType._type && this._subtype === mediaType._subtype;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns The serialized media type.\n\t */\n\ttoString(): string {\n\t\treturn `${this.essence}${this._parameters.toString()}`;\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t * @returns The class name\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaType';\n\t}\n}"],
5
- "mappings": ";AAAO,IAAM,sBAA8B;;;ACE3C,IAAM,UAAkB;AACxB,IAAM,kCAA0C;AAazC,IAAM,sBAAN,MAAM,6BAA4B,IAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5D,YAAY,UAAsC,CAAC,GAAG;AACrD,UAAM,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,OAAO,QAAQ,MAAc,OAAwB;AACpD,WAAO,oBAAoB,KAAK,IAAI,KAAK,gCAAgC,KAAK,KAAK;AAAA,EACpF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQS,IAAI,MAAkC;AAC9C,WAAO,MAAM,IAAI,KAAK,YAAY,CAAC;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQS,IAAI,MAAuB;AACnC,WAAO,MAAM,IAAI,KAAK,YAAY,CAAC;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUS,IAAI,MAAc,OAAqB;AAC/C,QAAI,CAAC,qBAAoB,QAAQ,MAAM,KAAK,GAAG;AAC9C,YAAM,IAAI,MAAM,4CAA4C,IAAI,IAAI,KAAK,EAAE;AAAA,IAC5E;AAEA,UAAM,IAAI,KAAK,YAAY,GAAG,KAAK;AAEnC,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQS,OAAO,MAAuB;AACtC,WAAO,MAAM,OAAO,KAAK,YAAY,CAAC;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MediaTypeParameters", "entries", "name", "value", "httpTokenCodePoints", "whitespaceChars", "trailingWhitespace", "leadingAndTrailingWhitespace", "MediaTypeParser", "_MediaTypeParser", "input", "position", "type", "typeEnd", "httpTokenCodePoints", "subtype", "subtypeEnd", "parameters", "MediaTypeParameters", "name", "value", "pos", "stopChars", "lowerCase", "trim", "result", "length", "char", "component", "MediaType", "_MediaType", "mediaType", "parameters", "MediaTypeParser", "name", "value"]
7
7
  }
package/package.json CHANGED
@@ -1,86 +1,86 @@
1
1
  {
2
- "name": "@d1g1tal/media-type",
3
- "description": "Parses, serializes, and manipulates media types, according to the WHATWG MIME Sniffing Standard",
4
- "version": "6.0.3",
5
- "author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
6
- "maintainers": [
7
- {
8
- "name": "Jason DiMeo",
9
- "email": "jason.dimeo@gmail.com"
10
- }
11
- ],
12
- "license": "ISC",
13
- "packageManager": "pnpm@10.30.3",
14
- "engines": {
15
- "node": ">=20.16.0"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/D1g1talEntr0py/media-type.git"
20
- },
21
- "bugs": {
22
- "url": "https://github.com/D1g1talEntr0py/media-type/issues"
23
- },
24
- "homepage": "https://github.com/D1g1talEntr0py/media-type#readme",
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "type": "module",
29
- "exports": {
30
- ".": {
31
- "types": "./dist/media-type.d.ts",
32
- "import": "./dist/media-type.js"
33
- }
34
- },
35
- "files": [
36
- "/dist",
37
- "README.md",
38
- "LICENSE",
39
- "CHANGELOG.md"
40
- ],
41
- "keywords": [
42
- "content-type",
43
- "mime type",
44
- "media type",
45
- "mimesniff",
46
- "mime",
47
- "http",
48
- "whatwg",
49
- "typescript",
50
- "esm",
51
- "parser",
52
- "serializer"
53
- ],
54
- "scripts": {
55
- "build": "tsbuild",
56
- "type-check": "tsbuild --noEmit",
57
- "test": "vitest run",
58
- "test:watch": "vitest",
59
- "test:ui": "vitest run --ui",
60
- "test:coverage": "vitest run --coverage",
61
- "lint": "eslint",
62
- "pretest": "node tests/scripts/get-latest-platform-tests.ts",
63
- "prepublishOnly": "pnpm lint && pnpm build"
64
- },
65
- "devDependencies": {
66
- "@d1g1tal/tsbuild": "^1.3.2",
67
- "@eslint/js": "^10.0.1",
68
- "@types/node": "^25.3.3",
69
- "@typescript-eslint/eslint-plugin": "^8.56.1",
70
- "@typescript-eslint/parser": "^8.56.1",
71
- "@typescript/lib-dom": "npm:@types/web@^0.0.339",
72
- "@vitest/coverage-v8": "4.0.18",
73
- "@vitest/ui": "^4.0.18",
74
- "eslint": "^10.0.2",
75
- "eslint-plugin-jsdoc": "^62.7.1",
76
- "printable-string": "^0.3.0",
77
- "typescript": "^5.9.3",
78
- "typescript-eslint": "^8.56.1",
79
- "vitest": "^4.0.18",
80
- "whatwg-encoding": "^3.1.1"
81
- },
82
- "browserslist": [
83
- "defaults and fully supports es6-module",
84
- "maintained node versions"
85
- ]
86
- }
2
+ "name": "@d1g1tal/media-type",
3
+ "author": "D1g1talEntr0py",
4
+ "version": "6.0.6",
5
+ "license": "MIT",
6
+ "description": "Parses, serializes, and manipulates media types, according to the WHATWG MIME Sniffing Standard",
7
+ "homepage": "https://github.com/D1g1talEntr0py/media-type#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/D1g1talEntr0py/media-type.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/D1g1talEntr0py/media-type/issues"
14
+ },
15
+ "maintainers": [
16
+ {
17
+ "name": "D1g1talEntr0py",
18
+ "email": "jason.dimeo@gmail.com"
19
+ }
20
+ ],
21
+ "engines": {
22
+ "node": ">=20.16.0"
23
+ },
24
+ "publishConfig": {
25
+ "registry": "https://registry.npmjs.org",
26
+ "access": "public"
27
+ },
28
+ "type": "module",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/media-type.d.ts",
32
+ "import": "./dist/media-type.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "/dist",
37
+ "README.md",
38
+ "LICENSE",
39
+ "CHANGELOG.md"
40
+ ],
41
+ "devDependencies": {
42
+ "@d1g1tal/tsbuild": "^1.6.1",
43
+ "@eslint/js": "^10.0.1",
44
+ "@exodus/bytes": "^1.15.0",
45
+ "@types/node": "^25.5.0",
46
+ "@typescript-eslint/eslint-plugin": "^8.57.1",
47
+ "@typescript-eslint/parser": "^8.57.1",
48
+ "@typescript/lib-dom": "npm:@types/web@^0.0.343",
49
+ "@vitest/coverage-v8": "4.1.0",
50
+ "@vitest/ui": "^4.1.0",
51
+ "eslint": "^10.0.3",
52
+ "eslint-plugin-jsdoc": "^62.8.0",
53
+ "printable-string": "^0.3.0",
54
+ "typescript": "^5.9.3",
55
+ "typescript-eslint": "^8.57.1",
56
+ "vitest": "^4.1.0"
57
+ },
58
+ "browserslist": [
59
+ "defaults and fully supports es6-module",
60
+ "maintained node versions"
61
+ ],
62
+ "keywords": [
63
+ "content-type",
64
+ "mime type",
65
+ "media type",
66
+ "mimesniff",
67
+ "mime",
68
+ "http",
69
+ "whatwg",
70
+ "typescript",
71
+ "esm",
72
+ "parser",
73
+ "serializer"
74
+ ],
75
+ "scripts": {
76
+ "build": "tsbuild",
77
+ "build:watch": "tsbuild --watch",
78
+ "type-check": "tsbuild --noEmit",
79
+ "lint": "eslint ./src",
80
+ "pretest": "node tests/scripts/get-latest-platform-tests.ts",
81
+ "test": "vitest run",
82
+ "test:watch": "vitest",
83
+ "test:ui": "vitest run --ui",
84
+ "test:coverage": "vitest run --coverage"
85
+ }
86
+ }