├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── lib ├── mime-type-parameters.js ├── mime-type.js ├── parser.js ├── serializer.js └── utils.js ├── package-lock.json ├── package.json ├── scripts ├── .eslintrc.json └── get-latest-platform-tests.js └── test ├── api.js ├── web-platform-tests └── .gitkeep └── web-platform.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 2 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /coverage/** 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": "@domenic", 4 | "env": { 5 | "node": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # lint requires lf line endings 2 | *.js text eol=lf 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | pull_request: 4 | branches: [main] 5 | push: 6 | branches: [main] 7 | jobs: 8 | build: 9 | name: Lint and tests 10 | runs-on: ubuntu-latest 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | node-version: 15 | - 18 16 | - 20 17 | - latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: actions/setup-node@v4 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: npm ci 24 | - run: npm run lint 25 | - run: npm test 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /npm-debug.log 3 | 4 | /coverage/ 5 | /test/web-platform-tests/* 6 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © Domenic Denicola 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Parse, serialize, and manipulate MIME types 2 | 3 | This package will parse [MIME types](https://mimesniff.spec.whatwg.org/#understanding-mime-types) into a structured format, which can then be manipulated and serialized: 4 | 5 | ```js 6 | const MIMEType = require("whatwg-mimetype"); 7 | 8 | const mimeType = new MIMEType(`Text/HTML;Charset="utf-8"`); 9 | 10 | console.assert(mimeType.toString() === "text/html;charset=utf-8"); 11 | 12 | console.assert(mimeType.type === "text"); 13 | console.assert(mimeType.subtype === "html"); 14 | console.assert(mimeType.essence === "text/html"); 15 | console.assert(mimeType.parameters.get("charset") === "utf-8"); 16 | 17 | mimeType.parameters.set("charset", "windows-1252"); 18 | console.assert(mimeType.parameters.get("charset") === "windows-1252"); 19 | console.assert(mimeType.toString() === "text/html;charset=windows-1252"); 20 | 21 | console.assert(mimeType.isHTML() === true); 22 | console.assert(mimeType.isXML() === false); 23 | ``` 24 | 25 | Parsing is a fairly complex process; see [the specification](https://mimesniff.spec.whatwg.org/#parsing-a-mime-type) for details (and similarly [for serialization](https://mimesniff.spec.whatwg.org/#serializing-a-mime-type)). 26 | 27 | This package's algorithms conform to those of the WHATWG [MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/), and is aligned up to commit [8e9a7dd](https://github.com/whatwg/mimesniff/commit/8e9a7dd90717c595a4e4d982cd216e4411d33736). 28 | 29 | ## `MIMEType` API 30 | 31 | This package's main module's default export is a class, `MIMEType`. Its constructor takes a string which it will attempt to parse into a MIME type; if parsing fails, an `Error` will be thrown. 32 | 33 | ### The `parse()` static factory method 34 | 35 | As an alternative to the constructor, you can use `MIMEType.parse(string)`. The only difference is that `parse()` will return `null` on failed parsing, whereas the constructor will throw. It thus makes the most sense to use the constructor in cases where unparseable MIME types would be exceptional, and use `parse()` when dealing with input from some unconstrained source. 36 | 37 | ### Properties 38 | 39 | - `type`: the MIME type's [type](https://mimesniff.spec.whatwg.org/#mime-type-type), e.g. `"text"` 40 | - `subtype`: the MIME type's [subtype](https://mimesniff.spec.whatwg.org/#mime-type-subtype), e.g. `"html"` 41 | - `essence`: the MIME type's [essence](https://mimesniff.spec.whatwg.org/#mime-type-essence), e.g. `"text/html"` 42 | - `parameters`: an instance of `MIMETypeParameters`, containing this MIME type's [parameters](https://mimesniff.spec.whatwg.org/#mime-type-parameters) 43 | 44 | `type` and `subtype` can be changed. They will be validated to be non-empty and only contain [HTTP token code points](https://mimesniff.spec.whatwg.org/#http-token-code-point). 45 | 46 | `essence` is only a getter, and cannot be changed. 47 | 48 | `parameters` is also a getter, but the contents of the `MIMETypeParameters` object are mutable, as described below. 49 | 50 | ### Methods 51 | 52 | - `toString()` serializes the MIME type to a string 53 | - `isHTML()`: returns true if this instance represents [a HTML MIME type](https://mimesniff.spec.whatwg.org/#html-mime-type) 54 | - `isXML()`: returns true if this instance represents [an XML MIME type](https://mimesniff.spec.whatwg.org/#xml-mime-type) 55 | - `isJavaScript({ prohibitParameters })`: returns true if this instance represents [a JavaScript MIME type](https://html.spec.whatwg.org/multipage/scripting.html#javascript-mime-type). `prohibitParameters` can be set to true to disallow any parameters, i.e. to test if the MIME type's serialization is a [JavaScript MIME type essence match](https://mimesniff.spec.whatwg.org/#javascript-mime-type-essence-match). 56 | 57 | _Note: the `isHTML()`, `isXML()`, and `isJavaScript()` methods are speculative, and may be removed or changed in future major versions. See [whatwg/mimesniff#48](https://github.com/whatwg/mimesniff/issues/48) for brainstorming in this area. Currently we implement these mainly because they are useful in jsdom._ 58 | 59 | ## `MIMETypeParameters` API 60 | 61 | The `MIMETypeParameters` class, instances of which are returned by `mimeType.parameters`, has equivalent surface API to a [JavaScript `Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). 62 | 63 | However, `MIMETypeParameters` methods will always interpret their arguments as appropriate for MIME types, so e.g. parameter names will be lowercased, and attempting to set invalid characters will throw. 64 | 65 | Some examples: 66 | 67 | ```js 68 | const mimeType = new MIMEType(`x/x;a=b;c=D;E="F"`); 69 | 70 | // Logs: 71 | // a b 72 | // c D 73 | // e F 74 | for (const [name, value] of mimeType.parameters) { 75 | console.log(name, value); 76 | } 77 | 78 | console.assert(mimeType.parameters.has("a")); 79 | console.assert(mimeType.parameters.has("A")); 80 | console.assert(mimeType.parameters.get("A") === "b"); 81 | 82 | mimeType.parameters.set("Q", "X"); 83 | console.assert(mimeType.parameters.get("q") === "X"); 84 | console.assert(mimeType.toString() === "x/x;a=b;c=d;e=F;q=X"); 85 | 86 | // Throws: 87 | mimeType.parameters.set("@", "x"); 88 | ``` 89 | 90 | ## Raw parsing/serialization APIs 91 | 92 | If you want primitives on which to build your own API, you can get direct access to the parsing and serialization algorithms as follows: 93 | 94 | ```js 95 | const parse = require("whatwg-mimetype/lib/parser"); 96 | const serialize = require("whatwg-mimetype/lib/serializer"); 97 | ``` 98 | 99 | `parse(string)` returns an object containing the `type` and `subtype` strings, plus `parameters`, which is a `Map`. This is roughly our equivalent of the spec's [MIME type record](https://mimesniff.spec.whatwg.org/#mime-type). If parsing fails, it instead returns `null`. 100 | 101 | `serialize(record)` operates on the such an object, giving back a string according to the serialization algorithm. 102 | -------------------------------------------------------------------------------- /lib/mime-type-parameters.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const { 3 | asciiLowercase, 4 | solelyContainsHTTPTokenCodePoints, 5 | soleyContainsHTTPQuotedStringTokenCodePoints 6 | } = require("./utils.js"); 7 | 8 | module.exports = class MIMETypeParameters { 9 | constructor(map) { 10 | this._map = map; 11 | } 12 | 13 | get size() { 14 | return this._map.size; 15 | } 16 | 17 | get(name) { 18 | name = asciiLowercase(String(name)); 19 | return this._map.get(name); 20 | } 21 | 22 | has(name) { 23 | name = asciiLowercase(String(name)); 24 | return this._map.has(name); 25 | } 26 | 27 | set(name, value) { 28 | name = asciiLowercase(String(name)); 29 | value = String(value); 30 | 31 | if (!solelyContainsHTTPTokenCodePoints(name)) { 32 | throw new Error(`Invalid MIME type parameter name "${name}": only HTTP token code points are valid.`); 33 | } 34 | if (!soleyContainsHTTPQuotedStringTokenCodePoints(value)) { 35 | throw new Error(`Invalid MIME type parameter value "${value}": only HTTP quoted-string token code points are ` + 36 | `valid.`); 37 | } 38 | 39 | return this._map.set(name, value); 40 | } 41 | 42 | clear() { 43 | this._map.clear(); 44 | } 45 | 46 | delete(name) { 47 | name = asciiLowercase(String(name)); 48 | return this._map.delete(name); 49 | } 50 | 51 | forEach(callbackFn, thisArg) { 52 | this._map.forEach(callbackFn, thisArg); 53 | } 54 | 55 | keys() { 56 | return this._map.keys(); 57 | } 58 | 59 | values() { 60 | return this._map.values(); 61 | } 62 | 63 | entries() { 64 | return this._map.entries(); 65 | } 66 | 67 | [Symbol.iterator]() { 68 | return this._map[Symbol.iterator](); 69 | } 70 | }; 71 | -------------------------------------------------------------------------------- /lib/mime-type.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const MIMETypeParameters = require("./mime-type-parameters.js"); 3 | const parse = require("./parser.js"); 4 | const serialize = require("./serializer.js"); 5 | const { 6 | asciiLowercase, 7 | solelyContainsHTTPTokenCodePoints 8 | } = require("./utils.js"); 9 | 10 | module.exports = class MIMEType { 11 | constructor(string) { 12 | string = String(string); 13 | const result = parse(string); 14 | if (result === null) { 15 | throw new Error(`Could not parse MIME type string "${string}"`); 16 | } 17 | 18 | this._type = result.type; 19 | this._subtype = result.subtype; 20 | this._parameters = new MIMETypeParameters(result.parameters); 21 | } 22 | 23 | static parse(string) { 24 | try { 25 | return new this(string); 26 | } catch (e) { 27 | return null; 28 | } 29 | } 30 | 31 | get essence() { 32 | return `${this.type}/${this.subtype}`; 33 | } 34 | 35 | get type() { 36 | return this._type; 37 | } 38 | 39 | set type(value) { 40 | value = asciiLowercase(String(value)); 41 | 42 | if (value.length === 0) { 43 | throw new Error("Invalid type: must be a non-empty string"); 44 | } 45 | if (!solelyContainsHTTPTokenCodePoints(value)) { 46 | throw new Error(`Invalid type ${value}: must contain only HTTP token code points`); 47 | } 48 | 49 | this._type = value; 50 | } 51 | 52 | get subtype() { 53 | return this._subtype; 54 | } 55 | 56 | set subtype(value) { 57 | value = asciiLowercase(String(value)); 58 | 59 | if (value.length === 0) { 60 | throw new Error("Invalid subtype: must be a non-empty string"); 61 | } 62 | if (!solelyContainsHTTPTokenCodePoints(value)) { 63 | throw new Error(`Invalid subtype ${value}: must contain only HTTP token code points`); 64 | } 65 | 66 | this._subtype = value; 67 | } 68 | 69 | get parameters() { 70 | return this._parameters; 71 | } 72 | 73 | toString() { 74 | // The serialize function works on both "MIME type records" (i.e. the results of parse) and on this class, since 75 | // this class's interface is identical. 76 | return serialize(this); 77 | } 78 | 79 | isJavaScript({ prohibitParameters = false } = {}) { 80 | switch (this._type) { 81 | case "text": { 82 | switch (this._subtype) { 83 | case "ecmascript": 84 | case "javascript": 85 | case "javascript1.0": 86 | case "javascript1.1": 87 | case "javascript1.2": 88 | case "javascript1.3": 89 | case "javascript1.4": 90 | case "javascript1.5": 91 | case "jscript": 92 | case "livescript": 93 | case "x-ecmascript": 94 | case "x-javascript": { 95 | return !prohibitParameters || this._parameters.size === 0; 96 | } 97 | default: { 98 | return false; 99 | } 100 | } 101 | } 102 | case "application": { 103 | switch (this._subtype) { 104 | case "ecmascript": 105 | case "javascript": 106 | case "x-ecmascript": 107 | case "x-javascript": { 108 | return !prohibitParameters || this._parameters.size === 0; 109 | } 110 | default: { 111 | return false; 112 | } 113 | } 114 | } 115 | default: { 116 | return false; 117 | } 118 | } 119 | } 120 | isXML() { 121 | return (this._subtype === "xml" && (this._type === "text" || this._type === "application")) || 122 | this._subtype.endsWith("+xml"); 123 | } 124 | isHTML() { 125 | return this._subtype === "html" && this._type === "text"; 126 | } 127 | }; 128 | -------------------------------------------------------------------------------- /lib/parser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const { 3 | removeLeadingAndTrailingHTTPWhitespace, 4 | removeTrailingHTTPWhitespace, 5 | isHTTPWhitespaceChar, 6 | solelyContainsHTTPTokenCodePoints, 7 | soleyContainsHTTPQuotedStringTokenCodePoints, 8 | asciiLowercase, 9 | collectAnHTTPQuotedString 10 | } = require("./utils.js"); 11 | 12 | module.exports = input => { 13 | input = removeLeadingAndTrailingHTTPWhitespace(input); 14 | 15 | let position = 0; 16 | let type = ""; 17 | while (position < input.length && input[position] !== "/") { 18 | type += input[position]; 19 | ++position; 20 | } 21 | 22 | if (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) { 23 | return null; 24 | } 25 | 26 | if (position >= input.length) { 27 | return null; 28 | } 29 | 30 | // Skips past "/" 31 | ++position; 32 | 33 | let subtype = ""; 34 | while (position < input.length && input[position] !== ";") { 35 | subtype += input[position]; 36 | ++position; 37 | } 38 | 39 | subtype = removeTrailingHTTPWhitespace(subtype); 40 | 41 | if (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) { 42 | return null; 43 | } 44 | 45 | const mimeType = { 46 | type: asciiLowercase(type), 47 | subtype: asciiLowercase(subtype), 48 | parameters: new Map() 49 | }; 50 | 51 | while (position < input.length) { 52 | // Skip past ";" 53 | ++position; 54 | 55 | while (isHTTPWhitespaceChar(input[position])) { 56 | ++position; 57 | } 58 | 59 | let parameterName = ""; 60 | while (position < input.length && input[position] !== ";" && input[position] !== "=") { 61 | parameterName += input[position]; 62 | ++position; 63 | } 64 | parameterName = asciiLowercase(parameterName); 65 | 66 | if (position < input.length) { 67 | if (input[position] === ";") { 68 | continue; 69 | } 70 | 71 | // Skip past "=" 72 | ++position; 73 | } 74 | 75 | let parameterValue = null; 76 | if (input[position] === "\"") { 77 | [parameterValue, position] = collectAnHTTPQuotedString(input, position); 78 | 79 | while (position < input.length && input[position] !== ";") { 80 | ++position; 81 | } 82 | } else { 83 | parameterValue = ""; 84 | while (position < input.length && input[position] !== ";") { 85 | parameterValue += input[position]; 86 | ++position; 87 | } 88 | 89 | parameterValue = removeTrailingHTTPWhitespace(parameterValue); 90 | 91 | if (parameterValue === "") { 92 | continue; 93 | } 94 | } 95 | 96 | if (parameterName.length > 0 && 97 | solelyContainsHTTPTokenCodePoints(parameterName) && 98 | soleyContainsHTTPQuotedStringTokenCodePoints(parameterValue) && 99 | !mimeType.parameters.has(parameterName)) { 100 | mimeType.parameters.set(parameterName, parameterValue); 101 | } 102 | } 103 | 104 | return mimeType; 105 | }; 106 | -------------------------------------------------------------------------------- /lib/serializer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const { solelyContainsHTTPTokenCodePoints } = require("./utils.js"); 3 | 4 | module.exports = mimeType => { 5 | let serialization = `${mimeType.type}/${mimeType.subtype}`; 6 | 7 | if (mimeType.parameters.size === 0) { 8 | return serialization; 9 | } 10 | 11 | for (let [name, value] of mimeType.parameters) { 12 | serialization += ";"; 13 | serialization += name; 14 | serialization += "="; 15 | 16 | if (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) { 17 | value = value.replace(/(["\\])/ug, "\\$1"); 18 | value = `"${value}"`; 19 | } 20 | 21 | serialization += value; 22 | } 23 | 24 | return serialization; 25 | }; 26 | -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.removeLeadingAndTrailingHTTPWhitespace = string => { 4 | return string.replace(/^[ \t\n\r]+/u, "").replace(/[ \t\n\r]+$/u, ""); 5 | }; 6 | 7 | exports.removeTrailingHTTPWhitespace = string => { 8 | return string.replace(/[ \t\n\r]+$/u, ""); 9 | }; 10 | 11 | exports.isHTTPWhitespaceChar = char => { 12 | return char === " " || char === "\t" || char === "\n" || char === "\r"; 13 | }; 14 | 15 | exports.solelyContainsHTTPTokenCodePoints = string => { 16 | return /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(string); 17 | }; 18 | 19 | exports.soleyContainsHTTPQuotedStringTokenCodePoints = string => { 20 | return /^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(string); 21 | }; 22 | 23 | exports.asciiLowercase = string => { 24 | return string.replace(/[A-Z]/ug, l => l.toLowerCase()); 25 | }; 26 | 27 | // This variant only implements it with the extract-value flag set. 28 | exports.collectAnHTTPQuotedString = (input, position) => { 29 | let value = ""; 30 | 31 | position++; 32 | 33 | while (true) { 34 | while (position < input.length && input[position] !== "\"" && input[position] !== "\\") { 35 | value += input[position]; 36 | ++position; 37 | } 38 | 39 | if (position >= input.length) { 40 | break; 41 | } 42 | 43 | const quoteOrBackslash = input[position]; 44 | ++position; 45 | 46 | if (quoteOrBackslash === "\\") { 47 | if (position >= input.length) { 48 | value += "\\"; 49 | break; 50 | } 51 | 52 | value += input[position]; 53 | ++position; 54 | } else { 55 | break; 56 | } 57 | } 58 | 59 | return [value, position]; 60 | }; 61 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whatwg-mimetype", 3 | "version": "4.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "whatwg-mimetype", 9 | "version": "4.0.0", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "@domenic/eslint-config": "^3.0.0", 13 | "c8": "^8.0.1", 14 | "eslint": "^8.53.0", 15 | "printable-string": "^0.3.0", 16 | "whatwg-encoding": "^3.0.0" 17 | }, 18 | "engines": { 19 | "node": ">=18" 20 | } 21 | }, 22 | "node_modules/@aashutoshrathi/word-wrap": { 23 | "version": "1.2.6", 24 | "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", 25 | "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", 26 | "dev": true, 27 | "engines": { 28 | "node": ">=0.10.0" 29 | } 30 | }, 31 | "node_modules/@bcoe/v8-coverage": { 32 | "version": "0.2.3", 33 | "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", 34 | "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", 35 | "dev": true 36 | }, 37 | "node_modules/@domenic/eslint-config": { 38 | "version": "3.0.0", 39 | "resolved": "https://registry.npmjs.org/@domenic/eslint-config/-/eslint-config-3.0.0.tgz", 40 | "integrity": "sha512-XhG03wcob9LIzTfucyl0jhoIueVynfyk/i1HmrZqf7x2iKrLh9TN/+5pbWFuHB3cvyS5Pn3OVyUJ8NHSsOIejQ==", 41 | "dev": true, 42 | "peerDependencies": { 43 | "eslint": "^8.28.0" 44 | } 45 | }, 46 | "node_modules/@eslint-community/eslint-utils": { 47 | "version": "4.4.0", 48 | "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", 49 | "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", 50 | "dev": true, 51 | "dependencies": { 52 | "eslint-visitor-keys": "^3.3.0" 53 | }, 54 | "engines": { 55 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 56 | }, 57 | "peerDependencies": { 58 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 59 | } 60 | }, 61 | "node_modules/@eslint-community/regexpp": { 62 | "version": "4.10.0", 63 | "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", 64 | "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", 65 | "dev": true, 66 | "engines": { 67 | "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 68 | } 69 | }, 70 | "node_modules/@eslint/eslintrc": { 71 | "version": "2.1.3", 72 | "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", 73 | "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", 74 | "dev": true, 75 | "dependencies": { 76 | "ajv": "^6.12.4", 77 | "debug": "^4.3.2", 78 | "espree": "^9.6.0", 79 | "globals": "^13.19.0", 80 | "ignore": "^5.2.0", 81 | "import-fresh": "^3.2.1", 82 | "js-yaml": "^4.1.0", 83 | "minimatch": "^3.1.2", 84 | "strip-json-comments": "^3.1.1" 85 | }, 86 | "engines": { 87 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 88 | }, 89 | "funding": { 90 | "url": "https://opencollective.com/eslint" 91 | } 92 | }, 93 | "node_modules/@eslint/js": { 94 | "version": "8.53.0", 95 | "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", 96 | "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", 97 | "dev": true, 98 | "engines": { 99 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 100 | } 101 | }, 102 | "node_modules/@humanwhocodes/config-array": { 103 | "version": "0.11.13", 104 | "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", 105 | "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", 106 | "dev": true, 107 | "dependencies": { 108 | "@humanwhocodes/object-schema": "^2.0.1", 109 | "debug": "^4.1.1", 110 | "minimatch": "^3.0.5" 111 | }, 112 | "engines": { 113 | "node": ">=10.10.0" 114 | } 115 | }, 116 | "node_modules/@humanwhocodes/module-importer": { 117 | "version": "1.0.1", 118 | "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", 119 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 120 | "dev": true, 121 | "engines": { 122 | "node": ">=12.22" 123 | }, 124 | "funding": { 125 | "type": "github", 126 | "url": "https://github.com/sponsors/nzakas" 127 | } 128 | }, 129 | "node_modules/@humanwhocodes/object-schema": { 130 | "version": "2.0.1", 131 | "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", 132 | "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", 133 | "dev": true 134 | }, 135 | "node_modules/@istanbuljs/schema": { 136 | "version": "0.1.3", 137 | "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", 138 | "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", 139 | "dev": true, 140 | "engines": { 141 | "node": ">=8" 142 | } 143 | }, 144 | "node_modules/@jridgewell/resolve-uri": { 145 | "version": "3.1.1", 146 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", 147 | "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", 148 | "dev": true, 149 | "engines": { 150 | "node": ">=6.0.0" 151 | } 152 | }, 153 | "node_modules/@jridgewell/sourcemap-codec": { 154 | "version": "1.4.15", 155 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 156 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", 157 | "dev": true 158 | }, 159 | "node_modules/@jridgewell/trace-mapping": { 160 | "version": "0.3.20", 161 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", 162 | "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", 163 | "dev": true, 164 | "dependencies": { 165 | "@jridgewell/resolve-uri": "^3.1.0", 166 | "@jridgewell/sourcemap-codec": "^1.4.14" 167 | } 168 | }, 169 | "node_modules/@nodelib/fs.scandir": { 170 | "version": "2.1.5", 171 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 172 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 173 | "dev": true, 174 | "dependencies": { 175 | "@nodelib/fs.stat": "2.0.5", 176 | "run-parallel": "^1.1.9" 177 | }, 178 | "engines": { 179 | "node": ">= 8" 180 | } 181 | }, 182 | "node_modules/@nodelib/fs.stat": { 183 | "version": "2.0.5", 184 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 185 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 186 | "dev": true, 187 | "engines": { 188 | "node": ">= 8" 189 | } 190 | }, 191 | "node_modules/@nodelib/fs.walk": { 192 | "version": "1.2.8", 193 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 194 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 195 | "dev": true, 196 | "dependencies": { 197 | "@nodelib/fs.scandir": "2.1.5", 198 | "fastq": "^1.6.0" 199 | }, 200 | "engines": { 201 | "node": ">= 8" 202 | } 203 | }, 204 | "node_modules/@types/istanbul-lib-coverage": { 205 | "version": "2.0.6", 206 | "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", 207 | "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", 208 | "dev": true 209 | }, 210 | "node_modules/@ungap/structured-clone": { 211 | "version": "1.2.0", 212 | "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", 213 | "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", 214 | "dev": true 215 | }, 216 | "node_modules/acorn": { 217 | "version": "8.11.2", 218 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", 219 | "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", 220 | "dev": true, 221 | "bin": { 222 | "acorn": "bin/acorn" 223 | }, 224 | "engines": { 225 | "node": ">=0.4.0" 226 | } 227 | }, 228 | "node_modules/acorn-jsx": { 229 | "version": "5.3.2", 230 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", 231 | "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 232 | "dev": true, 233 | "peerDependencies": { 234 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 235 | } 236 | }, 237 | "node_modules/ajv": { 238 | "version": "6.12.6", 239 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 240 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 241 | "dev": true, 242 | "dependencies": { 243 | "fast-deep-equal": "^3.1.1", 244 | "fast-json-stable-stringify": "^2.0.0", 245 | "json-schema-traverse": "^0.4.1", 246 | "uri-js": "^4.2.2" 247 | }, 248 | "funding": { 249 | "type": "github", 250 | "url": "https://github.com/sponsors/epoberezkin" 251 | } 252 | }, 253 | "node_modules/ansi-regex": { 254 | "version": "5.0.1", 255 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 256 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 257 | "dev": true, 258 | "engines": { 259 | "node": ">=8" 260 | } 261 | }, 262 | "node_modules/ansi-styles": { 263 | "version": "4.3.0", 264 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 265 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 266 | "dev": true, 267 | "dependencies": { 268 | "color-convert": "^2.0.1" 269 | }, 270 | "engines": { 271 | "node": ">=8" 272 | }, 273 | "funding": { 274 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 275 | } 276 | }, 277 | "node_modules/argparse": { 278 | "version": "2.0.1", 279 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 280 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 281 | "dev": true 282 | }, 283 | "node_modules/balanced-match": { 284 | "version": "1.0.2", 285 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 286 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 287 | "dev": true 288 | }, 289 | "node_modules/brace-expansion": { 290 | "version": "1.1.11", 291 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 292 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 293 | "dev": true, 294 | "dependencies": { 295 | "balanced-match": "^1.0.0", 296 | "concat-map": "0.0.1" 297 | } 298 | }, 299 | "node_modules/c8": { 300 | "version": "8.0.1", 301 | "resolved": "https://registry.npmjs.org/c8/-/c8-8.0.1.tgz", 302 | "integrity": "sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==", 303 | "dev": true, 304 | "dependencies": { 305 | "@bcoe/v8-coverage": "^0.2.3", 306 | "@istanbuljs/schema": "^0.1.3", 307 | "find-up": "^5.0.0", 308 | "foreground-child": "^2.0.0", 309 | "istanbul-lib-coverage": "^3.2.0", 310 | "istanbul-lib-report": "^3.0.1", 311 | "istanbul-reports": "^3.1.6", 312 | "rimraf": "^3.0.2", 313 | "test-exclude": "^6.0.0", 314 | "v8-to-istanbul": "^9.0.0", 315 | "yargs": "^17.7.2", 316 | "yargs-parser": "^21.1.1" 317 | }, 318 | "bin": { 319 | "c8": "bin/c8.js" 320 | }, 321 | "engines": { 322 | "node": ">=12" 323 | } 324 | }, 325 | "node_modules/callsites": { 326 | "version": "3.1.0", 327 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 328 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 329 | "dev": true, 330 | "engines": { 331 | "node": ">=6" 332 | } 333 | }, 334 | "node_modules/chalk": { 335 | "version": "4.1.2", 336 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 337 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 338 | "dev": true, 339 | "dependencies": { 340 | "ansi-styles": "^4.1.0", 341 | "supports-color": "^7.1.0" 342 | }, 343 | "engines": { 344 | "node": ">=10" 345 | }, 346 | "funding": { 347 | "url": "https://github.com/chalk/chalk?sponsor=1" 348 | } 349 | }, 350 | "node_modules/cliui": { 351 | "version": "8.0.1", 352 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", 353 | "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", 354 | "dev": true, 355 | "dependencies": { 356 | "string-width": "^4.2.0", 357 | "strip-ansi": "^6.0.1", 358 | "wrap-ansi": "^7.0.0" 359 | }, 360 | "engines": { 361 | "node": ">=12" 362 | } 363 | }, 364 | "node_modules/color-convert": { 365 | "version": "2.0.1", 366 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 367 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 368 | "dev": true, 369 | "dependencies": { 370 | "color-name": "~1.1.4" 371 | }, 372 | "engines": { 373 | "node": ">=7.0.0" 374 | } 375 | }, 376 | "node_modules/color-name": { 377 | "version": "1.1.4", 378 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 379 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 380 | "dev": true 381 | }, 382 | "node_modules/concat-map": { 383 | "version": "0.0.1", 384 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 385 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 386 | "dev": true 387 | }, 388 | "node_modules/convert-source-map": { 389 | "version": "2.0.0", 390 | "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", 391 | "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", 392 | "dev": true 393 | }, 394 | "node_modules/cross-spawn": { 395 | "version": "7.0.3", 396 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 397 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 398 | "dev": true, 399 | "dependencies": { 400 | "path-key": "^3.1.0", 401 | "shebang-command": "^2.0.0", 402 | "which": "^2.0.1" 403 | }, 404 | "engines": { 405 | "node": ">= 8" 406 | } 407 | }, 408 | "node_modules/debug": { 409 | "version": "4.3.4", 410 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 411 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 412 | "dev": true, 413 | "dependencies": { 414 | "ms": "2.1.2" 415 | }, 416 | "engines": { 417 | "node": ">=6.0" 418 | }, 419 | "peerDependenciesMeta": { 420 | "supports-color": { 421 | "optional": true 422 | } 423 | } 424 | }, 425 | "node_modules/deep-is": { 426 | "version": "0.1.4", 427 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 428 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 429 | "dev": true 430 | }, 431 | "node_modules/doctrine": { 432 | "version": "3.0.0", 433 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", 434 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 435 | "dev": true, 436 | "dependencies": { 437 | "esutils": "^2.0.2" 438 | }, 439 | "engines": { 440 | "node": ">=6.0.0" 441 | } 442 | }, 443 | "node_modules/emoji-regex": { 444 | "version": "8.0.0", 445 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 446 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 447 | "dev": true 448 | }, 449 | "node_modules/escalade": { 450 | "version": "3.1.1", 451 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 452 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 453 | "dev": true, 454 | "engines": { 455 | "node": ">=6" 456 | } 457 | }, 458 | "node_modules/escape-string-regexp": { 459 | "version": "4.0.0", 460 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 461 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 462 | "dev": true, 463 | "engines": { 464 | "node": ">=10" 465 | }, 466 | "funding": { 467 | "url": "https://github.com/sponsors/sindresorhus" 468 | } 469 | }, 470 | "node_modules/eslint": { 471 | "version": "8.53.0", 472 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", 473 | "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", 474 | "dev": true, 475 | "dependencies": { 476 | "@eslint-community/eslint-utils": "^4.2.0", 477 | "@eslint-community/regexpp": "^4.6.1", 478 | "@eslint/eslintrc": "^2.1.3", 479 | "@eslint/js": "8.53.0", 480 | "@humanwhocodes/config-array": "^0.11.13", 481 | "@humanwhocodes/module-importer": "^1.0.1", 482 | "@nodelib/fs.walk": "^1.2.8", 483 | "@ungap/structured-clone": "^1.2.0", 484 | "ajv": "^6.12.4", 485 | "chalk": "^4.0.0", 486 | "cross-spawn": "^7.0.2", 487 | "debug": "^4.3.2", 488 | "doctrine": "^3.0.0", 489 | "escape-string-regexp": "^4.0.0", 490 | "eslint-scope": "^7.2.2", 491 | "eslint-visitor-keys": "^3.4.3", 492 | "espree": "^9.6.1", 493 | "esquery": "^1.4.2", 494 | "esutils": "^2.0.2", 495 | "fast-deep-equal": "^3.1.3", 496 | "file-entry-cache": "^6.0.1", 497 | "find-up": "^5.0.0", 498 | "glob-parent": "^6.0.2", 499 | "globals": "^13.19.0", 500 | "graphemer": "^1.4.0", 501 | "ignore": "^5.2.0", 502 | "imurmurhash": "^0.1.4", 503 | "is-glob": "^4.0.0", 504 | "is-path-inside": "^3.0.3", 505 | "js-yaml": "^4.1.0", 506 | "json-stable-stringify-without-jsonify": "^1.0.1", 507 | "levn": "^0.4.1", 508 | "lodash.merge": "^4.6.2", 509 | "minimatch": "^3.1.2", 510 | "natural-compare": "^1.4.0", 511 | "optionator": "^0.9.3", 512 | "strip-ansi": "^6.0.1", 513 | "text-table": "^0.2.0" 514 | }, 515 | "bin": { 516 | "eslint": "bin/eslint.js" 517 | }, 518 | "engines": { 519 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 520 | }, 521 | "funding": { 522 | "url": "https://opencollective.com/eslint" 523 | } 524 | }, 525 | "node_modules/eslint-scope": { 526 | "version": "7.2.2", 527 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", 528 | "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", 529 | "dev": true, 530 | "dependencies": { 531 | "esrecurse": "^4.3.0", 532 | "estraverse": "^5.2.0" 533 | }, 534 | "engines": { 535 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 536 | }, 537 | "funding": { 538 | "url": "https://opencollective.com/eslint" 539 | } 540 | }, 541 | "node_modules/eslint-visitor-keys": { 542 | "version": "3.4.3", 543 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", 544 | "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", 545 | "dev": true, 546 | "engines": { 547 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 548 | }, 549 | "funding": { 550 | "url": "https://opencollective.com/eslint" 551 | } 552 | }, 553 | "node_modules/espree": { 554 | "version": "9.6.1", 555 | "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", 556 | "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", 557 | "dev": true, 558 | "dependencies": { 559 | "acorn": "^8.9.0", 560 | "acorn-jsx": "^5.3.2", 561 | "eslint-visitor-keys": "^3.4.1" 562 | }, 563 | "engines": { 564 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 565 | }, 566 | "funding": { 567 | "url": "https://opencollective.com/eslint" 568 | } 569 | }, 570 | "node_modules/esquery": { 571 | "version": "1.5.0", 572 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", 573 | "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", 574 | "dev": true, 575 | "dependencies": { 576 | "estraverse": "^5.1.0" 577 | }, 578 | "engines": { 579 | "node": ">=0.10" 580 | } 581 | }, 582 | "node_modules/esrecurse": { 583 | "version": "4.3.0", 584 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 585 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 586 | "dev": true, 587 | "dependencies": { 588 | "estraverse": "^5.2.0" 589 | }, 590 | "engines": { 591 | "node": ">=4.0" 592 | } 593 | }, 594 | "node_modules/estraverse": { 595 | "version": "5.3.0", 596 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 597 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 598 | "dev": true, 599 | "engines": { 600 | "node": ">=4.0" 601 | } 602 | }, 603 | "node_modules/esutils": { 604 | "version": "2.0.3", 605 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 606 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 607 | "dev": true, 608 | "engines": { 609 | "node": ">=0.10.0" 610 | } 611 | }, 612 | "node_modules/fast-deep-equal": { 613 | "version": "3.1.3", 614 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 615 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 616 | "dev": true 617 | }, 618 | "node_modules/fast-json-stable-stringify": { 619 | "version": "2.1.0", 620 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 621 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 622 | "dev": true 623 | }, 624 | "node_modules/fast-levenshtein": { 625 | "version": "2.0.6", 626 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 627 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 628 | "dev": true 629 | }, 630 | "node_modules/fastq": { 631 | "version": "1.15.0", 632 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", 633 | "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", 634 | "dev": true, 635 | "dependencies": { 636 | "reusify": "^1.0.4" 637 | } 638 | }, 639 | "node_modules/file-entry-cache": { 640 | "version": "6.0.1", 641 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", 642 | "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", 643 | "dev": true, 644 | "dependencies": { 645 | "flat-cache": "^3.0.4" 646 | }, 647 | "engines": { 648 | "node": "^10.12.0 || >=12.0.0" 649 | } 650 | }, 651 | "node_modules/find-up": { 652 | "version": "5.0.0", 653 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 654 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 655 | "dev": true, 656 | "dependencies": { 657 | "locate-path": "^6.0.0", 658 | "path-exists": "^4.0.0" 659 | }, 660 | "engines": { 661 | "node": ">=10" 662 | }, 663 | "funding": { 664 | "url": "https://github.com/sponsors/sindresorhus" 665 | } 666 | }, 667 | "node_modules/flat-cache": { 668 | "version": "3.1.1", 669 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", 670 | "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", 671 | "dev": true, 672 | "dependencies": { 673 | "flatted": "^3.2.9", 674 | "keyv": "^4.5.3", 675 | "rimraf": "^3.0.2" 676 | }, 677 | "engines": { 678 | "node": ">=12.0.0" 679 | } 680 | }, 681 | "node_modules/flatted": { 682 | "version": "3.2.9", 683 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", 684 | "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", 685 | "dev": true 686 | }, 687 | "node_modules/foreground-child": { 688 | "version": "2.0.0", 689 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", 690 | "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", 691 | "dev": true, 692 | "dependencies": { 693 | "cross-spawn": "^7.0.0", 694 | "signal-exit": "^3.0.2" 695 | }, 696 | "engines": { 697 | "node": ">=8.0.0" 698 | } 699 | }, 700 | "node_modules/fs.realpath": { 701 | "version": "1.0.0", 702 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 703 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", 704 | "dev": true 705 | }, 706 | "node_modules/get-caller-file": { 707 | "version": "2.0.5", 708 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 709 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 710 | "dev": true, 711 | "engines": { 712 | "node": "6.* || 8.* || >= 10.*" 713 | } 714 | }, 715 | "node_modules/glob": { 716 | "version": "7.2.3", 717 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 718 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 719 | "dev": true, 720 | "dependencies": { 721 | "fs.realpath": "^1.0.0", 722 | "inflight": "^1.0.4", 723 | "inherits": "2", 724 | "minimatch": "^3.1.1", 725 | "once": "^1.3.0", 726 | "path-is-absolute": "^1.0.0" 727 | }, 728 | "engines": { 729 | "node": "*" 730 | }, 731 | "funding": { 732 | "url": "https://github.com/sponsors/isaacs" 733 | } 734 | }, 735 | "node_modules/glob-parent": { 736 | "version": "6.0.2", 737 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", 738 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 739 | "dev": true, 740 | "dependencies": { 741 | "is-glob": "^4.0.3" 742 | }, 743 | "engines": { 744 | "node": ">=10.13.0" 745 | } 746 | }, 747 | "node_modules/globals": { 748 | "version": "13.23.0", 749 | "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", 750 | "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", 751 | "dev": true, 752 | "dependencies": { 753 | "type-fest": "^0.20.2" 754 | }, 755 | "engines": { 756 | "node": ">=8" 757 | }, 758 | "funding": { 759 | "url": "https://github.com/sponsors/sindresorhus" 760 | } 761 | }, 762 | "node_modules/graphemer": { 763 | "version": "1.4.0", 764 | "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", 765 | "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", 766 | "dev": true 767 | }, 768 | "node_modules/has-flag": { 769 | "version": "4.0.0", 770 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 771 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 772 | "dev": true, 773 | "engines": { 774 | "node": ">=8" 775 | } 776 | }, 777 | "node_modules/html-escaper": { 778 | "version": "2.0.2", 779 | "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", 780 | "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", 781 | "dev": true 782 | }, 783 | "node_modules/iconv-lite": { 784 | "version": "0.6.3", 785 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 786 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 787 | "dev": true, 788 | "dependencies": { 789 | "safer-buffer": ">= 2.1.2 < 3.0.0" 790 | }, 791 | "engines": { 792 | "node": ">=0.10.0" 793 | } 794 | }, 795 | "node_modules/ignore": { 796 | "version": "5.2.4", 797 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", 798 | "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", 799 | "dev": true, 800 | "engines": { 801 | "node": ">= 4" 802 | } 803 | }, 804 | "node_modules/import-fresh": { 805 | "version": "3.3.0", 806 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", 807 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 808 | "dev": true, 809 | "dependencies": { 810 | "parent-module": "^1.0.0", 811 | "resolve-from": "^4.0.0" 812 | }, 813 | "engines": { 814 | "node": ">=6" 815 | }, 816 | "funding": { 817 | "url": "https://github.com/sponsors/sindresorhus" 818 | } 819 | }, 820 | "node_modules/imurmurhash": { 821 | "version": "0.1.4", 822 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 823 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 824 | "dev": true, 825 | "engines": { 826 | "node": ">=0.8.19" 827 | } 828 | }, 829 | "node_modules/inflight": { 830 | "version": "1.0.6", 831 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 832 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 833 | "dev": true, 834 | "dependencies": { 835 | "once": "^1.3.0", 836 | "wrappy": "1" 837 | } 838 | }, 839 | "node_modules/inherits": { 840 | "version": "2.0.4", 841 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 842 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 843 | "dev": true 844 | }, 845 | "node_modules/is-extglob": { 846 | "version": "2.1.1", 847 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 848 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 849 | "dev": true, 850 | "engines": { 851 | "node": ">=0.10.0" 852 | } 853 | }, 854 | "node_modules/is-fullwidth-code-point": { 855 | "version": "3.0.0", 856 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 857 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 858 | "dev": true, 859 | "engines": { 860 | "node": ">=8" 861 | } 862 | }, 863 | "node_modules/is-glob": { 864 | "version": "4.0.3", 865 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 866 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 867 | "dev": true, 868 | "dependencies": { 869 | "is-extglob": "^2.1.1" 870 | }, 871 | "engines": { 872 | "node": ">=0.10.0" 873 | } 874 | }, 875 | "node_modules/is-path-inside": { 876 | "version": "3.0.3", 877 | "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", 878 | "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", 879 | "dev": true, 880 | "engines": { 881 | "node": ">=8" 882 | } 883 | }, 884 | "node_modules/isexe": { 885 | "version": "2.0.0", 886 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 887 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 888 | "dev": true 889 | }, 890 | "node_modules/istanbul-lib-coverage": { 891 | "version": "3.2.2", 892 | "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", 893 | "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", 894 | "dev": true, 895 | "engines": { 896 | "node": ">=8" 897 | } 898 | }, 899 | "node_modules/istanbul-lib-report": { 900 | "version": "3.0.1", 901 | "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", 902 | "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", 903 | "dev": true, 904 | "dependencies": { 905 | "istanbul-lib-coverage": "^3.0.0", 906 | "make-dir": "^4.0.0", 907 | "supports-color": "^7.1.0" 908 | }, 909 | "engines": { 910 | "node": ">=10" 911 | } 912 | }, 913 | "node_modules/istanbul-reports": { 914 | "version": "3.1.6", 915 | "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", 916 | "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", 917 | "dev": true, 918 | "dependencies": { 919 | "html-escaper": "^2.0.0", 920 | "istanbul-lib-report": "^3.0.0" 921 | }, 922 | "engines": { 923 | "node": ">=8" 924 | } 925 | }, 926 | "node_modules/js-yaml": { 927 | "version": "4.1.0", 928 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 929 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 930 | "dev": true, 931 | "dependencies": { 932 | "argparse": "^2.0.1" 933 | }, 934 | "bin": { 935 | "js-yaml": "bin/js-yaml.js" 936 | } 937 | }, 938 | "node_modules/json-buffer": { 939 | "version": "3.0.1", 940 | "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", 941 | "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", 942 | "dev": true 943 | }, 944 | "node_modules/json-schema-traverse": { 945 | "version": "0.4.1", 946 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 947 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 948 | "dev": true 949 | }, 950 | "node_modules/json-stable-stringify-without-jsonify": { 951 | "version": "1.0.1", 952 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 953 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 954 | "dev": true 955 | }, 956 | "node_modules/keyv": { 957 | "version": "4.5.4", 958 | "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", 959 | "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", 960 | "dev": true, 961 | "dependencies": { 962 | "json-buffer": "3.0.1" 963 | } 964 | }, 965 | "node_modules/levn": { 966 | "version": "0.4.1", 967 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 968 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 969 | "dev": true, 970 | "dependencies": { 971 | "prelude-ls": "^1.2.1", 972 | "type-check": "~0.4.0" 973 | }, 974 | "engines": { 975 | "node": ">= 0.8.0" 976 | } 977 | }, 978 | "node_modules/locate-path": { 979 | "version": "6.0.0", 980 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 981 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 982 | "dev": true, 983 | "dependencies": { 984 | "p-locate": "^5.0.0" 985 | }, 986 | "engines": { 987 | "node": ">=10" 988 | }, 989 | "funding": { 990 | "url": "https://github.com/sponsors/sindresorhus" 991 | } 992 | }, 993 | "node_modules/lodash.merge": { 994 | "version": "4.6.2", 995 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", 996 | "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 997 | "dev": true 998 | }, 999 | "node_modules/lru-cache": { 1000 | "version": "6.0.0", 1001 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 1002 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 1003 | "dev": true, 1004 | "dependencies": { 1005 | "yallist": "^4.0.0" 1006 | }, 1007 | "engines": { 1008 | "node": ">=10" 1009 | } 1010 | }, 1011 | "node_modules/make-dir": { 1012 | "version": "4.0.0", 1013 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", 1014 | "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", 1015 | "dev": true, 1016 | "dependencies": { 1017 | "semver": "^7.5.3" 1018 | }, 1019 | "engines": { 1020 | "node": ">=10" 1021 | }, 1022 | "funding": { 1023 | "url": "https://github.com/sponsors/sindresorhus" 1024 | } 1025 | }, 1026 | "node_modules/minimatch": { 1027 | "version": "3.1.2", 1028 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1029 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1030 | "dev": true, 1031 | "dependencies": { 1032 | "brace-expansion": "^1.1.7" 1033 | }, 1034 | "engines": { 1035 | "node": "*" 1036 | } 1037 | }, 1038 | "node_modules/ms": { 1039 | "version": "2.1.2", 1040 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1041 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1042 | "dev": true 1043 | }, 1044 | "node_modules/natural-compare": { 1045 | "version": "1.4.0", 1046 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1047 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 1048 | "dev": true 1049 | }, 1050 | "node_modules/once": { 1051 | "version": "1.4.0", 1052 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1053 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 1054 | "dev": true, 1055 | "dependencies": { 1056 | "wrappy": "1" 1057 | } 1058 | }, 1059 | "node_modules/optionator": { 1060 | "version": "0.9.3", 1061 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", 1062 | "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", 1063 | "dev": true, 1064 | "dependencies": { 1065 | "@aashutoshrathi/word-wrap": "^1.2.3", 1066 | "deep-is": "^0.1.3", 1067 | "fast-levenshtein": "^2.0.6", 1068 | "levn": "^0.4.1", 1069 | "prelude-ls": "^1.2.1", 1070 | "type-check": "^0.4.0" 1071 | }, 1072 | "engines": { 1073 | "node": ">= 0.8.0" 1074 | } 1075 | }, 1076 | "node_modules/p-limit": { 1077 | "version": "3.1.0", 1078 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 1079 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 1080 | "dev": true, 1081 | "dependencies": { 1082 | "yocto-queue": "^0.1.0" 1083 | }, 1084 | "engines": { 1085 | "node": ">=10" 1086 | }, 1087 | "funding": { 1088 | "url": "https://github.com/sponsors/sindresorhus" 1089 | } 1090 | }, 1091 | "node_modules/p-locate": { 1092 | "version": "5.0.0", 1093 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 1094 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 1095 | "dev": true, 1096 | "dependencies": { 1097 | "p-limit": "^3.0.2" 1098 | }, 1099 | "engines": { 1100 | "node": ">=10" 1101 | }, 1102 | "funding": { 1103 | "url": "https://github.com/sponsors/sindresorhus" 1104 | } 1105 | }, 1106 | "node_modules/parent-module": { 1107 | "version": "1.0.1", 1108 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 1109 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 1110 | "dev": true, 1111 | "dependencies": { 1112 | "callsites": "^3.0.0" 1113 | }, 1114 | "engines": { 1115 | "node": ">=6" 1116 | } 1117 | }, 1118 | "node_modules/path-exists": { 1119 | "version": "4.0.0", 1120 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1121 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1122 | "dev": true, 1123 | "engines": { 1124 | "node": ">=8" 1125 | } 1126 | }, 1127 | "node_modules/path-is-absolute": { 1128 | "version": "1.0.1", 1129 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1130 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 1131 | "dev": true, 1132 | "engines": { 1133 | "node": ">=0.10.0" 1134 | } 1135 | }, 1136 | "node_modules/path-key": { 1137 | "version": "3.1.1", 1138 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1139 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1140 | "dev": true, 1141 | "engines": { 1142 | "node": ">=8" 1143 | } 1144 | }, 1145 | "node_modules/prelude-ls": { 1146 | "version": "1.2.1", 1147 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 1148 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 1149 | "dev": true, 1150 | "engines": { 1151 | "node": ">= 0.8.0" 1152 | } 1153 | }, 1154 | "node_modules/printable-string": { 1155 | "version": "0.3.0", 1156 | "resolved": "https://registry.npmjs.org/printable-string/-/printable-string-0.3.0.tgz", 1157 | "integrity": "sha512-nNoVBpxczYqkXPhWNMrEM3r8HpZbaAXk7nLd4j4OHaAHtaFFqZmDPkmxD4tHmr/ydzLLG9m8DjtrFct56LSdUw==", 1158 | "dev": true 1159 | }, 1160 | "node_modules/punycode": { 1161 | "version": "2.3.1", 1162 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", 1163 | "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", 1164 | "dev": true, 1165 | "engines": { 1166 | "node": ">=6" 1167 | } 1168 | }, 1169 | "node_modules/queue-microtask": { 1170 | "version": "1.2.3", 1171 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 1172 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 1173 | "dev": true, 1174 | "funding": [ 1175 | { 1176 | "type": "github", 1177 | "url": "https://github.com/sponsors/feross" 1178 | }, 1179 | { 1180 | "type": "patreon", 1181 | "url": "https://www.patreon.com/feross" 1182 | }, 1183 | { 1184 | "type": "consulting", 1185 | "url": "https://feross.org/support" 1186 | } 1187 | ] 1188 | }, 1189 | "node_modules/require-directory": { 1190 | "version": "2.1.1", 1191 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1192 | "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", 1193 | "dev": true, 1194 | "engines": { 1195 | "node": ">=0.10.0" 1196 | } 1197 | }, 1198 | "node_modules/resolve-from": { 1199 | "version": "4.0.0", 1200 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 1201 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 1202 | "dev": true, 1203 | "engines": { 1204 | "node": ">=4" 1205 | } 1206 | }, 1207 | "node_modules/reusify": { 1208 | "version": "1.0.4", 1209 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 1210 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 1211 | "dev": true, 1212 | "engines": { 1213 | "iojs": ">=1.0.0", 1214 | "node": ">=0.10.0" 1215 | } 1216 | }, 1217 | "node_modules/rimraf": { 1218 | "version": "3.0.2", 1219 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1220 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1221 | "dev": true, 1222 | "dependencies": { 1223 | "glob": "^7.1.3" 1224 | }, 1225 | "bin": { 1226 | "rimraf": "bin.js" 1227 | }, 1228 | "funding": { 1229 | "url": "https://github.com/sponsors/isaacs" 1230 | } 1231 | }, 1232 | "node_modules/run-parallel": { 1233 | "version": "1.2.0", 1234 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 1235 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 1236 | "dev": true, 1237 | "funding": [ 1238 | { 1239 | "type": "github", 1240 | "url": "https://github.com/sponsors/feross" 1241 | }, 1242 | { 1243 | "type": "patreon", 1244 | "url": "https://www.patreon.com/feross" 1245 | }, 1246 | { 1247 | "type": "consulting", 1248 | "url": "https://feross.org/support" 1249 | } 1250 | ], 1251 | "dependencies": { 1252 | "queue-microtask": "^1.2.2" 1253 | } 1254 | }, 1255 | "node_modules/safer-buffer": { 1256 | "version": "2.1.2", 1257 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1258 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1259 | "dev": true 1260 | }, 1261 | "node_modules/semver": { 1262 | "version": "7.5.4", 1263 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", 1264 | "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", 1265 | "dev": true, 1266 | "dependencies": { 1267 | "lru-cache": "^6.0.0" 1268 | }, 1269 | "bin": { 1270 | "semver": "bin/semver.js" 1271 | }, 1272 | "engines": { 1273 | "node": ">=10" 1274 | } 1275 | }, 1276 | "node_modules/shebang-command": { 1277 | "version": "2.0.0", 1278 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 1279 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 1280 | "dev": true, 1281 | "dependencies": { 1282 | "shebang-regex": "^3.0.0" 1283 | }, 1284 | "engines": { 1285 | "node": ">=8" 1286 | } 1287 | }, 1288 | "node_modules/shebang-regex": { 1289 | "version": "3.0.0", 1290 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 1291 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 1292 | "dev": true, 1293 | "engines": { 1294 | "node": ">=8" 1295 | } 1296 | }, 1297 | "node_modules/signal-exit": { 1298 | "version": "3.0.7", 1299 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", 1300 | "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", 1301 | "dev": true 1302 | }, 1303 | "node_modules/string-width": { 1304 | "version": "4.2.3", 1305 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1306 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1307 | "dev": true, 1308 | "dependencies": { 1309 | "emoji-regex": "^8.0.0", 1310 | "is-fullwidth-code-point": "^3.0.0", 1311 | "strip-ansi": "^6.0.1" 1312 | }, 1313 | "engines": { 1314 | "node": ">=8" 1315 | } 1316 | }, 1317 | "node_modules/strip-ansi": { 1318 | "version": "6.0.1", 1319 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1320 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1321 | "dev": true, 1322 | "dependencies": { 1323 | "ansi-regex": "^5.0.1" 1324 | }, 1325 | "engines": { 1326 | "node": ">=8" 1327 | } 1328 | }, 1329 | "node_modules/strip-json-comments": { 1330 | "version": "3.1.1", 1331 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 1332 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 1333 | "dev": true, 1334 | "engines": { 1335 | "node": ">=8" 1336 | }, 1337 | "funding": { 1338 | "url": "https://github.com/sponsors/sindresorhus" 1339 | } 1340 | }, 1341 | "node_modules/supports-color": { 1342 | "version": "7.2.0", 1343 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1344 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1345 | "dev": true, 1346 | "dependencies": { 1347 | "has-flag": "^4.0.0" 1348 | }, 1349 | "engines": { 1350 | "node": ">=8" 1351 | } 1352 | }, 1353 | "node_modules/test-exclude": { 1354 | "version": "6.0.0", 1355 | "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", 1356 | "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", 1357 | "dev": true, 1358 | "dependencies": { 1359 | "@istanbuljs/schema": "^0.1.2", 1360 | "glob": "^7.1.4", 1361 | "minimatch": "^3.0.4" 1362 | }, 1363 | "engines": { 1364 | "node": ">=8" 1365 | } 1366 | }, 1367 | "node_modules/text-table": { 1368 | "version": "0.2.0", 1369 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1370 | "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", 1371 | "dev": true 1372 | }, 1373 | "node_modules/type-check": { 1374 | "version": "0.4.0", 1375 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 1376 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 1377 | "dev": true, 1378 | "dependencies": { 1379 | "prelude-ls": "^1.2.1" 1380 | }, 1381 | "engines": { 1382 | "node": ">= 0.8.0" 1383 | } 1384 | }, 1385 | "node_modules/type-fest": { 1386 | "version": "0.20.2", 1387 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", 1388 | "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", 1389 | "dev": true, 1390 | "engines": { 1391 | "node": ">=10" 1392 | }, 1393 | "funding": { 1394 | "url": "https://github.com/sponsors/sindresorhus" 1395 | } 1396 | }, 1397 | "node_modules/uri-js": { 1398 | "version": "4.4.1", 1399 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 1400 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 1401 | "dev": true, 1402 | "dependencies": { 1403 | "punycode": "^2.1.0" 1404 | } 1405 | }, 1406 | "node_modules/v8-to-istanbul": { 1407 | "version": "9.1.3", 1408 | "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", 1409 | "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", 1410 | "dev": true, 1411 | "dependencies": { 1412 | "@jridgewell/trace-mapping": "^0.3.12", 1413 | "@types/istanbul-lib-coverage": "^2.0.1", 1414 | "convert-source-map": "^2.0.0" 1415 | }, 1416 | "engines": { 1417 | "node": ">=10.12.0" 1418 | } 1419 | }, 1420 | "node_modules/whatwg-encoding": { 1421 | "version": "3.0.0", 1422 | "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.0.0.tgz", 1423 | "integrity": "sha512-88G7S/pRxgJ2Bwz/CSHDojeOmsOkX2arGulkxhgPCiqE/URAasedYk8Tgonb1GDq/viM0vQkKUsk1faMw6m15A==", 1424 | "dev": true, 1425 | "dependencies": { 1426 | "iconv-lite": "0.6.3" 1427 | }, 1428 | "engines": { 1429 | "node": ">=18" 1430 | } 1431 | }, 1432 | "node_modules/which": { 1433 | "version": "2.0.2", 1434 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1435 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1436 | "dev": true, 1437 | "dependencies": { 1438 | "isexe": "^2.0.0" 1439 | }, 1440 | "bin": { 1441 | "node-which": "bin/node-which" 1442 | }, 1443 | "engines": { 1444 | "node": ">= 8" 1445 | } 1446 | }, 1447 | "node_modules/wrap-ansi": { 1448 | "version": "7.0.0", 1449 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1450 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1451 | "dev": true, 1452 | "dependencies": { 1453 | "ansi-styles": "^4.0.0", 1454 | "string-width": "^4.1.0", 1455 | "strip-ansi": "^6.0.0" 1456 | }, 1457 | "engines": { 1458 | "node": ">=10" 1459 | }, 1460 | "funding": { 1461 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1462 | } 1463 | }, 1464 | "node_modules/wrappy": { 1465 | "version": "1.0.2", 1466 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1467 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 1468 | "dev": true 1469 | }, 1470 | "node_modules/y18n": { 1471 | "version": "5.0.8", 1472 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1473 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 1474 | "dev": true, 1475 | "engines": { 1476 | "node": ">=10" 1477 | } 1478 | }, 1479 | "node_modules/yallist": { 1480 | "version": "4.0.0", 1481 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 1482 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", 1483 | "dev": true 1484 | }, 1485 | "node_modules/yargs": { 1486 | "version": "17.7.2", 1487 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", 1488 | "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", 1489 | "dev": true, 1490 | "dependencies": { 1491 | "cliui": "^8.0.1", 1492 | "escalade": "^3.1.1", 1493 | "get-caller-file": "^2.0.5", 1494 | "require-directory": "^2.1.1", 1495 | "string-width": "^4.2.3", 1496 | "y18n": "^5.0.5", 1497 | "yargs-parser": "^21.1.1" 1498 | }, 1499 | "engines": { 1500 | "node": ">=12" 1501 | } 1502 | }, 1503 | "node_modules/yargs-parser": { 1504 | "version": "21.1.1", 1505 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", 1506 | "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", 1507 | "dev": true, 1508 | "engines": { 1509 | "node": ">=12" 1510 | } 1511 | }, 1512 | "node_modules/yocto-queue": { 1513 | "version": "0.1.0", 1514 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 1515 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 1516 | "dev": true, 1517 | "engines": { 1518 | "node": ">=10" 1519 | }, 1520 | "funding": { 1521 | "url": "https://github.com/sponsors/sindresorhus" 1522 | } 1523 | } 1524 | } 1525 | } 1526 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whatwg-mimetype", 3 | "description": "Parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard", 4 | "keywords": [ 5 | "content-type", 6 | "mime type", 7 | "mimesniff", 8 | "http", 9 | "whatwg" 10 | ], 11 | "version": "4.0.0", 12 | "author": "Domenic Denicola (https://domenic.me/)", 13 | "license": "MIT", 14 | "repository": "jsdom/whatwg-mimetype", 15 | "main": "lib/mime-type.js", 16 | "files": [ 17 | "lib/" 18 | ], 19 | "scripts": { 20 | "test": "node --test", 21 | "coverage": "c8 node --test --experimental-test-coverage", 22 | "lint": "eslint .", 23 | "pretest": "node scripts/get-latest-platform-tests.js" 24 | }, 25 | "devDependencies": { 26 | "@domenic/eslint-config": "^3.0.0", 27 | "c8": "^8.0.1", 28 | "eslint": "^8.53.0", 29 | "printable-string": "^0.3.0", 30 | "whatwg-encoding": "^3.0.0" 31 | }, 32 | "engines": { 33 | "node": ">=18" 34 | }, 35 | "c8": { 36 | "reporter": [ 37 | "text", 38 | "html" 39 | ], 40 | "exclude": [ 41 | "scripts/", 42 | "test/" 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /scripts/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-process-env": "off", 4 | "no-process-exit": "off", 5 | "no-console": "off" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scripts/get-latest-platform-tests.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | if (process.env.NO_UPDATE) { 4 | process.exit(0); 5 | } 6 | 7 | const path = require("node:path"); 8 | const fs = require("node:fs/promises"); 9 | 10 | // Pin to specific version, reflecting the spec version in the readme. 11 | // 12 | // To get the latest commit: 13 | // 1. Go to https://github.com/w3c/web-platform-tests/tree/master/mimesniff 14 | // 2. Press "y" on your keyboard to get a permalink 15 | // 3. Copy the commit hash 16 | const commitHash = "ec13cf1ca3abf13ae1004003e791fd9937be0b49"; 17 | 18 | const urlPrefix = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}` + 19 | `/mimesniff/mime-types/resources/`; 20 | 21 | const files = ["mime-types.json", "generated-mime-types.json"]; 22 | 23 | async function main() { 24 | await Promise.all(files.map(async file => { 25 | const url = urlPrefix + file; 26 | const targetFile = path.resolve(__dirname, "..", "test", "web-platform-tests", file); 27 | const res = await fetch(url); 28 | await fs.writeFile(targetFile, res.body); 29 | })); 30 | } 31 | 32 | main().catch(e => { 33 | console.error(e.stack); 34 | process.exit(1); 35 | }); 36 | -------------------------------------------------------------------------------- /test/api.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const { describe, it, test, beforeEach } = require("node:test"); 3 | const assert = require("node:assert"); 4 | const MIMEType = require(".."); 5 | 6 | describe("Smoke tests via README intro example", () => { 7 | let mimeType; 8 | beforeEach(() => { 9 | mimeType = new MIMEType(`Text/HTML;Charset="utf-8"`); 10 | }); 11 | 12 | it("serializes correctly", () => { 13 | assert.equal(mimeType.toString(), "text/html;charset=utf-8"); 14 | }); 15 | 16 | it("has the correct type, subtype, and essence", () => { 17 | assert.equal(mimeType.type, "text"); 18 | assert.equal(mimeType.subtype, "html"); 19 | assert.equal(mimeType.essence, "text/html"); 20 | }); 21 | 22 | it("has the correct parameters", () => { 23 | assert.equal(mimeType.parameters.size, 1); 24 | assert.equal(mimeType.parameters.has("charset"), true); 25 | assert.equal(mimeType.parameters.get("charset"), "utf-8"); 26 | }); 27 | 28 | it("responds to parameter setting", () => { 29 | mimeType.parameters.set("charset", "windows-1252"); 30 | assert.equal(mimeType.parameters.get("charset"), "windows-1252"); 31 | assert.equal(mimeType.toString(), "text/html;charset=windows-1252"); 32 | }); 33 | }); 34 | 35 | describe("MIMETypeParameters object", () => { 36 | let mimeType; 37 | beforeEach(() => { 38 | mimeType = new MIMEType(`Text/HTML;Charset="utf-8";foo="bar"`); 39 | }); 40 | 41 | it("rejects setting only HTTP token code points in the name", () => { 42 | assert.throws(() => { 43 | mimeType.parameters.set("@", "a"); 44 | }); 45 | }); 46 | 47 | it("rejects setting only HTTP quoted string token code points in the value", () => { 48 | assert.throws(() => { 49 | mimeType.parameters.set("a", "\u0019"); 50 | }); 51 | }); 52 | 53 | it("has the correct keys, values, and entries", () => { 54 | assert.deepEqual(Array.from(mimeType.parameters.keys()), ["charset", "foo"]); 55 | assert.deepEqual(Array.from(mimeType.parameters.values()), ["utf-8", "bar"]); 56 | assert.deepEqual(Array.from(mimeType.parameters.entries()), [ 57 | ["charset", "utf-8"], 58 | ["foo", "bar"] 59 | ]); 60 | }); 61 | 62 | it("can be clear()ed", () => { 63 | mimeType.parameters.clear(); 64 | 65 | assert.equal(mimeType.parameters.size, 0); 66 | assert.deepEqual(Array.from(mimeType.parameters.keys()), []); 67 | assert.deepEqual(Array.from(mimeType.parameters.values()), []); 68 | assert.deepEqual(Array.from(mimeType.parameters.entries()), []); 69 | }); 70 | 71 | it("can have a parameter deleted, including by a non-canonical casing", () => { 72 | mimeType.parameters.delete("chArset"); 73 | assert.equal(mimeType.parameters.size, 1); 74 | assert.deepEqual(Array.from(mimeType.parameters.keys()), ["foo"]); 75 | }); 76 | 77 | it("can be iterated over with forEach()", () => { 78 | const entries = []; 79 | const thisArg = { this: "arg" }; 80 | const recordedThisArgs = []; 81 | mimeType.parameters.forEach(function (value, name) { 82 | entries.push([name, value]); 83 | recordedThisArgs.push(this); 84 | }, thisArg); 85 | 86 | assert.deepEqual(entries, [["charset", "utf-8"], ["foo", "bar"]]); 87 | assert.equal(recordedThisArgs.length, 2); 88 | assert.equal(recordedThisArgs[0], thisArg); 89 | assert.equal(recordedThisArgs[1], thisArg); 90 | }); 91 | }); 92 | 93 | describe("Constructor behavior", () => { 94 | it("converts incoming arguments into strings", () => { 95 | const arg = { 96 | toString() { 97 | return "text/HTML"; 98 | } 99 | }; 100 | const mimeType = new MIMEType(arg); 101 | 102 | assert.equal(mimeType.toString(), "text/html"); 103 | }); 104 | 105 | it("throws on unparseable MIME types", () => { 106 | assert.throws(() => new MIMEType("asdf")); 107 | assert.throws(() => new MIMEType("text/html™")); 108 | }); 109 | }); 110 | 111 | describe("static parse() behavior", () => { 112 | it("converts incoming arguments into strings", () => { 113 | const arg = { 114 | toString() { 115 | return "text/HTML"; 116 | } 117 | }; 118 | const mimeType = MIMEType.parse(arg); 119 | 120 | assert.equal(mimeType.toString(), "text/html"); 121 | }); 122 | 123 | it("returns null on unparseable MIME types", () => { 124 | assert.equal(MIMEType.parse("asdf"), null); 125 | assert.equal(MIMEType.parse("text/html™"), null); 126 | }); 127 | }); 128 | 129 | describe("type manipulation", () => { 130 | let mimeType; 131 | beforeEach(() => { 132 | mimeType = new MIMEType("application/xml;foo=bar"); 133 | }); 134 | 135 | it("responds to type being set", () => { 136 | mimeType.type = "text"; 137 | assert.equal(mimeType.type, "text"); 138 | assert.equal(mimeType.essence, "text/xml"); 139 | assert.equal(mimeType.toString(), "text/xml;foo=bar"); 140 | }); 141 | 142 | it("ASCII-lowercases incoming type strings", () => { 143 | mimeType.type = "TeXT"; 144 | assert.equal(mimeType.type, "text"); 145 | assert.equal(mimeType.essence, "text/xml"); 146 | assert.equal(mimeType.toString(), "text/xml;foo=bar"); 147 | }); 148 | 149 | it("converts the value set to a string", () => { 150 | mimeType.type = { 151 | toString() { 152 | return "TeXT"; 153 | } 154 | }; 155 | assert.equal(mimeType.type, "text"); 156 | assert.equal(mimeType.essence, "text/xml"); 157 | assert.equal(mimeType.toString(), "text/xml;foo=bar"); 158 | }); 159 | 160 | it("throws an error for non-HTTP token code points", () => { 161 | // not exhaustive; maybe later 162 | assert.throws(() => { 163 | mimeType.type = "/"; 164 | }); 165 | }); 166 | 167 | it("throws an error for an empty string", () => { 168 | assert.throws(() => { 169 | mimeType.type = ""; 170 | }); 171 | }); 172 | }); 173 | 174 | describe("subtype manipulation", () => { 175 | let mimeType; 176 | beforeEach(() => { 177 | mimeType = new MIMEType("application/xml;foo=bar"); 178 | }); 179 | 180 | it("responds to type being set", () => { 181 | mimeType.subtype = "pdf"; 182 | assert.equal(mimeType.subtype, "pdf"); 183 | assert.equal(mimeType.essence, "application/pdf"); 184 | assert.equal(mimeType.toString(), "application/pdf;foo=bar"); 185 | }); 186 | 187 | it("ASCII-lowercases incoming type strings", () => { 188 | mimeType.subtype = "PdF"; 189 | assert.equal(mimeType.subtype, "pdf"); 190 | assert.equal(mimeType.essence, "application/pdf"); 191 | assert.equal(mimeType.toString(), "application/pdf;foo=bar"); 192 | }); 193 | 194 | it("converts the value set to a string", () => { 195 | mimeType.subtype = { 196 | toString() { 197 | return "PdF"; 198 | } 199 | }; 200 | assert.equal(mimeType.subtype, "pdf"); 201 | assert.equal(mimeType.essence, "application/pdf"); 202 | assert.equal(mimeType.toString(), "application/pdf;foo=bar"); 203 | }); 204 | 205 | it("throws an error for non-HTTP token code points", () => { 206 | // not exhaustive; maybe later 207 | assert.throws(() => { 208 | mimeType.subtype = "/"; 209 | }); 210 | }); 211 | 212 | it("throws an error for an empty string", () => { 213 | assert.throws(() => { 214 | mimeType.subtype = ""; 215 | }); 216 | }); 217 | }); 218 | 219 | describe("Group-testing functions", () => { 220 | test("isHTML", () => { 221 | assert.equal((new MIMEType("text/html")).isHTML(), true); 222 | assert.equal((new MIMEType("text/html;charset=utf-8")).isHTML(), true); 223 | assert.equal((new MIMEType("text/html;charset=utf-8;foo=bar")).isHTML(), true); 224 | 225 | assert.equal((new MIMEType("text/xhtml")).isHTML(), false); 226 | assert.equal((new MIMEType("application/html")).isHTML(), false); 227 | assert.equal((new MIMEType("application/xhtml+xml")).isHTML(), false); 228 | }); 229 | 230 | test("isXML", () => { 231 | assert.equal((new MIMEType("application/xml")).isXML(), true); 232 | assert.equal((new MIMEType("application/xml;charset=utf-8")).isXML(), true); 233 | assert.equal((new MIMEType("application/xml;charset=utf-8;foo=bar")).isXML(), true); 234 | 235 | assert.equal((new MIMEType("text/xml")).isXML(), true); 236 | assert.equal((new MIMEType("text/xml;charset=utf-8")).isXML(), true); 237 | assert.equal((new MIMEType("text/xml;charset=utf-8;foo=bar")).isXML(), true); 238 | 239 | assert.equal((new MIMEType("text/svg+xml")).isXML(), true); 240 | assert.equal((new MIMEType("text/svg+xml;charset=utf-8")).isXML(), true); 241 | assert.equal((new MIMEType("text/svg+xml;charset=utf-8;foo=bar")).isXML(), true); 242 | 243 | assert.equal((new MIMEType("application/xhtml+xml")).isXML(), true); 244 | assert.equal((new MIMEType("application/xhtml+xml;charset=utf-8")).isXML(), true); 245 | assert.equal((new MIMEType("application/xhtml+xml;charset=utf-8;foo=bar")).isXML(), true); 246 | 247 | assert.equal((new MIMEType("text/xhtml")).isXML(), false); 248 | assert.equal((new MIMEType("text/svg")).isXML(), false); 249 | assert.equal((new MIMEType("application/html")).isXML(), false); 250 | assert.equal((new MIMEType("application/xml+xhtml")).isXML(), false); 251 | }); 252 | 253 | test("isJavaScript", () => { 254 | for (const prohibitParameters of [false, true]) { 255 | assert.equal((new MIMEType("application/ecmascript")).isJavaScript({ prohibitParameters }), true); 256 | assert.equal((new MIMEType("application/javascript")).isJavaScript({ prohibitParameters }), true); 257 | assert.equal((new MIMEType("application/x-ecmascript")).isJavaScript({ prohibitParameters }), true); 258 | assert.equal((new MIMEType("application/x-javascript")).isJavaScript({ prohibitParameters }), true); 259 | assert.equal((new MIMEType("text/ecmascript")).isJavaScript({ prohibitParameters }), true); 260 | assert.equal((new MIMEType("text/javascript1.0")).isJavaScript({ prohibitParameters }), true); 261 | assert.equal((new MIMEType("text/javascript1.1")).isJavaScript({ prohibitParameters }), true); 262 | assert.equal((new MIMEType("text/javascript1.2")).isJavaScript({ prohibitParameters }), true); 263 | assert.equal((new MIMEType("text/javascript1.3")).isJavaScript({ prohibitParameters }), true); 264 | assert.equal((new MIMEType("text/javascript1.4")).isJavaScript({ prohibitParameters }), true); 265 | assert.equal((new MIMEType("text/javascript1.5")).isJavaScript({ prohibitParameters }), true); 266 | assert.equal((new MIMEType("text/jscript")).isJavaScript({ prohibitParameters }), true); 267 | assert.equal((new MIMEType("text/livescript")).isJavaScript({ prohibitParameters }), true); 268 | assert.equal((new MIMEType("text/x-ecmascript")).isJavaScript({ prohibitParameters }), true); 269 | assert.equal((new MIMEType("text/x-javascript")).isJavaScript({ prohibitParameters }), true); 270 | assert.equal((new MIMEType("text/javascript")).isJavaScript({ prohibitParameters }), true); 271 | 272 | assert.equal((new MIMEType("text/plain")).isJavaScript({ prohibitParameters }), false); 273 | assert.equal((new MIMEType("application/xhtml+xml")).isJavaScript({ prohibitParameters }), false); 274 | assert.equal((new MIMEType("video/javascript")).isJavaScript({ prohibitParameters }), false); 275 | } 276 | 277 | assert.equal((new MIMEType("text/plain;charset=utf-8")).isJavaScript(), false); 278 | assert.equal((new MIMEType("text/plain;charset=utf-8")).isJavaScript({ prohibitParameters: true }), false); 279 | 280 | assert.equal((new MIMEType("text/javascript;charset=utf-8")).isJavaScript(), true); 281 | assert.equal((new MIMEType("text/javascript;charset=utf-8")).isJavaScript({ prohibitParameters: true }), false); 282 | assert.equal((new MIMEType("text/javascript;charset=utf-8")).isJavaScript({}), true); 283 | assert.equal((new MIMEType("text/javascript;charset=utf-8")).isJavaScript({ prohibitParameters: true }), false); 284 | 285 | assert.equal((new MIMEType("text/javascript;charset=utf-8;goal=script")).isJavaScript(), true); 286 | assert.equal( 287 | (new MIMEType("text/javascript;charset=utf-8;goal=script")).isJavaScript({ prohibitParameters: true }), 288 | false 289 | ); 290 | 291 | assert.equal((new MIMEType("text/javascript;goal=module")).isJavaScript(), true); 292 | assert.equal((new MIMEType("text/javascript;goal=module")).isJavaScript({ prohibitParameters: true }), false); 293 | }); 294 | }); 295 | -------------------------------------------------------------------------------- /test/web-platform-tests/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsdom/whatwg-mimetype/1c8de95d7fe9b1b75af5a4fe507b3a758fe3ebe9/test/web-platform-tests/.gitkeep -------------------------------------------------------------------------------- /test/web-platform.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const { describe, test } = require("node:test"); 3 | const assert = require("node:assert"); 4 | const encodingLabelToName = require("whatwg-encoding").labelToName; 5 | const printableString = require("printable-string"); 6 | const testCases = require("./web-platform-tests/mime-types.json"); 7 | const generatedTestCases = require("./web-platform-tests/generated-mime-types.json"); 8 | const parse = require("../lib/parser.js"); 9 | const serialize = require("../lib/serializer.js"); 10 | 11 | describe("mime-types.json", () => { 12 | runTestCases(testCases); 13 | }); 14 | 15 | describe("generated-mime-types.json", () => { 16 | runTestCases(generatedTestCases); 17 | }); 18 | 19 | function runTestCases(cases) { 20 | for (const testCase of cases) { 21 | if (typeof testCase === "string") { 22 | // It's a comment 23 | continue; 24 | } 25 | 26 | test(printableString(testCase.input), () => { 27 | const parsed = parse(testCase.input); 28 | 29 | if (testCase.output === null) { 30 | assert.equal(parsed, null); 31 | } else { 32 | const serialized = serialize(parsed); 33 | assert.equal(serialized, testCase.output); 34 | 35 | const charset = parsed.parameters.get("charset"); 36 | const encoding = encodingLabelToName(charset); 37 | if (testCase.encoding !== null && testCase.encoding !== undefined) { 38 | assert.equal(encoding, testCase.encoding); 39 | } else { 40 | assert.equal(encoding, null); 41 | } 42 | } 43 | }); 44 | } 45 | } 46 | --------------------------------------------------------------------------------