From 6b7754f96c6c25d4183245b83adc536c4cc0320e Mon Sep 17 00:00:00 2001 From: sheo13666q <4567934+alexander-akait@users.noreply.github.com> Date: Fri, 20 Nov 2026 09:59:41 +0000 Subject: [PATCH] refactor: generate the options check with `schema-utils precompile` Replace the custom `scripts/generate-schema-check.mjs` with `schema-utils precompile --minify`, which handles the `instanceof` keyword and the documentation-only keywords itself, and minifies the check from 95 KB to 29 KB. --- .changeset/schema-utils-precompile.md | 5 + package-lock.json | 72 ++++---- package.json | 11 +- scripts/generate-schema-check.mjs | 171 ------------------ src/options.check.js | 8 +- .../logging.test.js.snap.webpack5 | 9 - types/options.check.d.ts | 10 +- 7 files changed, 54 insertions(+), 232 deletions(-) create mode 100644 .changeset/schema-utils-precompile.md delete mode 100644 scripts/generate-schema-check.mjs diff --git a/.changeset/schema-utils-precompile.md b/.changeset/schema-utils-precompile.md new file mode 100644 index 000000000..354c47a38 --- /dev/null +++ b/.changeset/schema-utils-precompile.md @@ -0,0 +1,5 @@ +--- +"webpack-dev-middleware": patch +--- + +Generate the precompiled options check with `schema-utils precompile --minify`, which makes it about a third of the size, so it loads faster. diff --git a/package-lock.json b/package-lock.json index 6c3a63707..db9e7420d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,7 @@ "memfs": "^4.68.2", "mime-db": "^1.54.0", "range-parser": "^1.3.0", - "schema-utils": "^4.3.3", - "ws": "8.23.0" + "schema-utils": "^4.8.5" }, "devDependencies": { "@babel/cli": "^8.0.6", @@ -32,7 +31,6 @@ "@types/node": "^26.4.1", "@types/ws": "^8.18.1", "acorn": "^8.18.0", - "ajv": "^8.20.0", "babel-jest": "^30.1.2", "babel-loader": "^10.1.1", "babel-plugin-istanbul": "^8.0.0", @@ -66,7 +64,7 @@ "router": "^2.2.0", "supertest": "^7.2.2", "typescript": "^6.0.3", - "webpack": "^5.110.3", + "webpack": "^5.113.0", "ws": "^8.18.3" }, "engines": { @@ -10253,9 +10251,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.0.tgz", - "integrity": "sha512-9vhedylFonb2YGogzUKX6+Ja72gOJbN1QHAqdrvqLwhdl/QWbKopzoUC9EbQNVsAns/bx/4uyqalrQAoy1IByw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.0.tgz", + "integrity": "sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -10442,7 +10440,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/es-object-atoms": { @@ -17185,15 +17183,14 @@ } }, "node_modules/minimizer-webpack-plugin": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.13.0.tgz", - "integrity": "sha512-OO1NF2zHj6sf4CNv2AsUWYcS8WEwkVKQDXxxKzlOxx1Xl+WlqYtVC+oNlGNwGkLAOnpj277BSHypWwRtd9w4JQ==", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.0.tgz", + "integrity": "sha512-PnvQXCJxhgH2ZVVO7Lj0sM6q8L1XGxnUvd8wVQIRwi8khMCLq5wg0Ngxe44bcuZL2FSN81RdVE7YHEVzTKsQDQ==", "devOptional": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.31", "jest-worker": "^27.4.5", - "schema-utils": "^4.3.3", + "schema-utils": "^4.6.0", "terser": "^5.51.0" }, "engines": { @@ -19027,9 +19024,9 @@ "license": "MIT" }, "node_modules/schema-utils": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.3.tgz", - "integrity": "sha512-qIfo3f+lRNqnMPgpXSKvUhsT3pY5U+ppmgGr4j8LanFP3W/Ze+xj8DY/dPb5qVu3m6qFIMyMWKVRLNKxrNhxWg==", + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.5.tgz", + "integrity": "sha512-K1RRP7aTUAY2lGXNzPwjMK6AMMzbETdpF3pTPMEnH/RrpmPx6K1X47/gSebrV+1I9pRcgpwZwqpYBlyZAsliiw==", "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.15", @@ -19915,9 +19912,9 @@ } }, "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", "devOptional": true, "license": "MIT", "engines": { @@ -19929,9 +19926,9 @@ } }, "node_modules/terser": { - "version": "5.51.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", - "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "version": "5.51.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.3.tgz", + "integrity": "sha512-j5jPZZ6Sz0Eg2unusKhdRzUhUlHXJ3Bw2AkIXyJ6AqajWwihUlZOdJS+KSnZzmtVk6mFGdm3hHg0+M2sgyEz5Q==", "devOptional": true, "license": "BSD-2-Clause", "dependencies": { @@ -20835,9 +20832,9 @@ "license": "MIT" }, "node_modules/watchpack": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.3.tgz", - "integrity": "sha512-s3NZy0QpTY9qGqzc0wtz4qI28z3+5qKbbAec4MV4G9N3CfgZ9wgvQRr0cl2jh/tqkWG1NWHkmVMHZpCamev5Wg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.4.tgz", + "integrity": "sha512-5H3Tce2GfzWbcr9VnSqyak2whFaONw4BdmI5BDnMXold4qSlCFd64XaMQESRh2vkDKmdUkv6rUo17UvZ9f9nXw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -20855,9 +20852,9 @@ "license": "Apache-2.0" }, "node_modules/webpack": { - "version": "5.112.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.2.tgz", - "integrity": "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g==", + "version": "5.113.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.113.0.tgz", + "integrity": "sha512-q54iF0LNaAAdLEt3al9qMXC2zARvcx7LVKjHp+ExjCRkGx0M8TmawGHAXykXwofWzxhNzPTAh3kLVXvNg0El4A==", "devOptional": true, "license": "MIT", "dependencies": { @@ -20868,16 +20865,15 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.26.0", - "es-module-lexer": "^2.1.0", + "enhanced-resolve": "^5.27.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", - "minimizer-webpack-plugin": "^5.13.0", - "schema-utils": "^4.8.1", - "tapable": "^2.3.0", - "watchpack": "^2.6.3", - "webpack-sources": "^3.6.0" + "minimizer-webpack-plugin": "^5.14.0", + "schema-utils": "^4.8.2", + "tapable": "^2.3.4", + "watchpack": "^2.6.4", + "webpack-sources": "^3.7.1" }, "bin": { "webpack": "bin/webpack.js" @@ -20896,9 +20892,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.6.0.tgz", - "integrity": "sha512-EIMmPVvNI0CYXyRPp34F2Qk7W37/BZVZIofS6LAUnrNjCVahS+hO4mxwFJDjQjODTGZDtVzLYoN2+1dYkhk9qA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.7.1.tgz", + "integrity": "sha512-mcxs7A2LsEdwsNqQburqS4QHPR2Ca3NGplUakn6J5GPQvnVZ4oD4IM4FJcT3f8AVN2e2EsjuIVxKj4rorHvyuQ==", "devOptional": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index de0a9e8ca..ffade1284 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "lint": "npm-run-all -l -p \"lint:**\"", "fix:js": "npm run lint:code -- --fix", "fix:prettier": "npm run lint:prettier -- --write", - "fix": "npm-run-all -l fix:js fix:schema-check fix:prettier", + "fix": "npm-run-all -l fix:schema fix:js fix:prettier", "clean": "del-cli client dist types", "prebuild": "npm run clean", "build:types": "tsc && tsc -p tsconfig.client.build.json && node ./scripts/mark-client-esm.mjs && prettier \"types/**/*.ts\" --write", @@ -84,14 +84,14 @@ "version": "changeset version", "release": "npm run build && changeset publish", "coverage:client": "node test/helpers/merge-coverage.js", - "lint:schema-check": "node ./scripts/generate-schema-check.mjs --check", - "fix:schema-check": "node ./scripts/generate-schema-check.mjs" + "lint:schema": "schema-utils precompile --check --minify src/options.json", + "fix:schema": "schema-utils precompile --minify src/options.json" }, "dependencies": { "memfs": "^4.68.2", "mime-db": "^1.54.0", "range-parser": "^1.3.0", - "schema-utils": "^4.3.3" + "schema-utils": "^4.8.5" }, "devDependencies": { "@babel/cli": "^8.0.6", @@ -110,7 +110,6 @@ "@types/node": "^26.4.1", "@types/ws": "^8.18.1", "acorn": "^8.18.0", - "ajv": "^8.20.0", "babel-jest": "^30.1.2", "babel-loader": "^10.1.1", "babel-plugin-istanbul": "^8.0.0", @@ -144,7 +143,7 @@ "router": "^2.2.0", "supertest": "^7.2.2", "typescript": "^6.0.3", - "webpack": "^5.110.3", + "webpack": "^5.113.0", "ws": "^8.18.3" }, "peerDependencies": { diff --git a/scripts/generate-schema-check.mjs b/scripts/generate-schema-check.mjs deleted file mode 100644 index e58a42592..000000000 --- a/scripts/generate-schema-check.mjs +++ /dev/null @@ -1,171 +0,0 @@ -import { readFile, writeFile } from "node:fs/promises"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import Ajv, { _ } from "ajv"; -import standaloneCode from "ajv/dist/standalone/index.js"; - -// Precompile `src/options.json` into a standalone validator, `src/options.check.js`. -// -// Validating the options compiles the schema with ajv on the first call, which -// cost ~160ms of the first `middleware()` — a one-time startup price paid on -// every dev server start. The generated validator answers the same question -// with no compile step, so the happy path never loads ajv at all; the real -// validator is only reached when the options are invalid, to build the -// readable error message (the same trick webpack uses for its own schema). -// -// Run `npm run fix:schema-check` to regenerate, `npm run lint:schema-check` to -// verify the committed output is current. - -const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); -const SCHEMA_PATH = path.join(ROOT, "src", "options.json"); -const OUTPUT_PATH = path.join(ROOT, "src", "options.check.js"); - -const BANNER = `// This file was automatically generated. -// DO NOT MODIFY BY HAND. Run \`npm run fix:schema-check\` to update. -/* eslint-disable */ -// @ts-nocheck -`; - -/** - * The constructors `"instanceof"` may name. ajv-keywords implements the keyword - * with a closure, which cannot be serialized into standalone code, so the - * keyword is re-implemented here as something ajv can emit inline. - */ -const CONSTRUCTORS = { - Buffer: _`Buffer`, - Function: _`Function`, - RegExp: _`RegExp`, -}; - -/** @typedef {Record} SchemaNode */ - -/** - * Walk every schema node, depth first. - * @param {unknown} node current node - * @param {(node: SchemaNode, pointer: string) => void} visit called for each object node - * @param {string} pointer JSON pointer to `node` - * @returns {void} - */ -function walkSchema(node, visit, pointer = "#") { - if (!node || typeof node !== "object") { - return; - } - - if (!Array.isArray(node)) { - visit(/** @type {SchemaNode} */ (node), pointer); - } - - for (const [key, value] of Object.entries(node)) { - walkSchema(value, visit, `${pointer}/${key}`); - } -} - -/** - * Reject schema constructs the generated validator would silently mistranslate. - * @param {SchemaNode} schema the options schema - * @returns {void} - */ -function assertSupportedSchema(schema) { - /** - * @param {SchemaNode} node the schema node to check - * @param {string} pointer JSON pointer to `node` - * @returns {void} - */ - const assertNode = (node, pointer) => { - // `unicode: false` below makes ajv measure string length in UTF-16 code - // units rather than code points. The two agree only at a bound of 1, where - // both mean "not empty". - if (node.minLength !== undefined && node.minLength !== 1) { - throw new Error( - `"minLength" must be 1, but is ${node.minLength} at ${pointer}.`, - ); - } - - if (node.maxLength !== undefined) { - throw new Error(`"maxLength" is not supported, found at ${pointer}.`); - } - - if ( - typeof node.instanceof === "string" && - !Object.hasOwn(CONSTRUCTORS, node.instanceof) - ) { - throw new Error( - `"instanceof": ${JSON.stringify(node.instanceof)} at ${pointer} is not supported. Add it to CONSTRUCTORS.`, - ); - } - }; - - walkSchema(schema, assertNode); -} - -/** - * @param {SchemaNode} schema the options schema - * @returns {string} source of the standalone validator - */ -function generate(schema) { - assertSupportedSchema(schema); - - const ajv = new Ajv({ - /* eslint-disable no-console -- a generator reports to the terminal */ - logger: { - log: console.log, - /** - * `unicode` is deprecated but still honoured, and `assertSupportedSchema` - * has already established that dropping it changes nothing here. - * @param {...unknown} args ajv's warning arguments - * @returns {void} - */ - warn: (...args) => { - if (!String(args[0]).includes("option unicode")) { - console.warn(...args); - } - }, - error: console.error, - }, - /* eslint-enable no-console */ - strict: false, - // The validator only reports whether the options are valid; `schema-utils` - // produces the messages, so collecting every error here would be wasted work. - allErrors: false, - verbose: false, - unicode: false, - code: { source: true, esm: false }, - }); - - ajv.addKeyword({ - keyword: "instanceof", - schemaType: "string", - /** - * @param {import("ajv").KeywordCxt} cxt keyword context - * @returns {void} - */ - code(cxt) { - cxt.fail( - _`!(${cxt.data} instanceof ${CONSTRUCTORS[/** @type {keyof typeof CONSTRUCTORS} */ (cxt.schema)]})`, - ); - }, - }); - - // Documentation-only keywords carried by the schema for the CLI and the docs. - for (const keyword of ["cli", "link"]) { - ajv.addKeyword({ keyword, schemaType: ["string", "object", "boolean"] }); - } - - return BANNER + standaloneCode.default(ajv, ajv.compile(schema)); -} - -const source = generate(JSON.parse(await readFile(SCHEMA_PATH, "utf8"))); - -if (process.argv.includes("--check")) { - const current = await readFile(OUTPUT_PATH, "utf8").catch(() => undefined); - - if (current !== source) { - // eslint-disable-next-line no-console - console.error( - `${path.relative(ROOT, OUTPUT_PATH)} is out of date — run \`npm run fix:schema-check\`.`, - ); - process.exitCode = 1; - } -} else { - await writeFile(OUTPUT_PATH, source); -} diff --git a/src/options.check.js b/src/options.check.js index e5b48dbbc..5e664af63 100644 --- a/src/options.check.js +++ b/src/options.check.js @@ -1,5 +1,7 @@ -// This file was automatically generated. -// DO NOT MODIFY BY HAND. Run `npm run fix:schema-check` to update. /* eslint-disable */ // @ts-nocheck -"use strict";module.exports = validate10;module.exports.default = validate10;const schema11 = {"definitions":{"HotClient":{"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"url":{"description":"Where the runtime connects: a path, an absolute url for an endpoint reached on another origin or through a proxy, or the parts of one that differ, with the rest resolved in the page, which is the only place the rest is known. Defaults to the resolved `hot.path`.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"pageParamPrefix":{"description":"Prefix of the page-url parameters that override `apply` for a single page, as in `?webpack-dev-middleware-hot=false`.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"}}},"CorsOrigin":{"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]}},"type":"object","properties":{"cache":{"description":"How responses are cached.","link":"https://github.com/webpack/webpack-dev-middleware#cache","type":"object","additionalProperties":false,"properties":{"etag":{"description":"Enable or disable etag generation.","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","type":"boolean"},"control":{"description":"Enable or disable setting `Cache-Control` response header.","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"immutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","type":"boolean"}}},"mime":{"description":"How a file's media type is decided.","link":"https://github.com/webpack/webpack-dev-middleware#mime","type":"object","additionalProperties":false,"properties":{"types":{"description":"Allows a user to register custom mime types or extension mappings.","type":"object"},"default":{"description":"Allows a user to register a default mime type when we can't determine the content type.","type":"string"}}},"mimeTypes":{"description":"Allows a user to register custom mime types or extension mappings.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypes","type":"object"},"mimeTypeDefault":{"description":"Allows a user to register a default mime type when we can't determine the content type.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypedefault","type":"string"},"writeToDisk":{"description":"Allows to write generated files on disk.","link":"https://github.com/webpack/webpack-dev-middleware#writetodisk","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"methods":{"description":"Allows to pass the list of HTTP request methods accepted by the middleware.","link":"https://github.com/webpack/webpack-dev-middleware#methods","type":"array","items":{"type":"string","minLength":1}},"headers":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"description":"key of header.","type":"string"},"value":{"description":"value of header.","type":"string"}}},"minItems":1},{"type":"object"},{"instanceof":"Function"}],"description":"Allows to pass custom HTTP headers on each request","link":"https://github.com/webpack/webpack-dev-middleware#headers"},"publicPath":{"description":"The `publicPath` specifies the public URL address of the output files when referenced in a browser.","link":"https://github.com/webpack/webpack-dev-middleware#publicpath","anyOf":[{"enum":["auto"]},{"type":"string"},{"instanceof":"Function"}]},"stats":{"description":"Stats options object or preset name.","link":"https://github.com/webpack/webpack-dev-middleware#stats","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"type":"object","additionalProperties":true}]},"serverSideRender":{"description":"Instructs the module to enable or disable the server-side rendering mode.","link":"https://github.com/webpack/webpack-dev-middleware#serversiderender","type":"boolean"},"outputFileSystem":{"description":"Set the default file system which will be used by webpack as primary destination of generated files.","link":"https://github.com/webpack/webpack-dev-middleware#outputfilesystem","type":"object"},"index":{"description":"Allows to serve an index of the directory.","link":"https://github.com/webpack/webpack-dev-middleware#index","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"modifyResponseData":{"description":"Allows to set up a callback to change the response data.","link":"https://github.com/webpack/webpack-dev-middleware#modifyresponsedata","instanceof":"Function"},"etag":{"description":"Enable or disable etag generation.","link":"https://github.com/webpack/webpack-dev-middleware#etag","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","link":"https://github.com/webpack/webpack-dev-middleware#lastmodified","type":"boolean"},"cacheControl":{"description":"Enable or disable setting `Cache-Control` response header.","link":"https://github.com/webpack/webpack-dev-middleware#cachecontrol","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"cacheImmutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","link":"https://github.com/webpack/webpack-dev-middleware#cacheimmutable","type":"boolean"},"forwardError":{"description":"Enable or disable forwarding errors to next middleware.","link":"https://github.com/webpack/webpack-dev-middleware#forwarderrors","type":"boolean"},"hot":{"description":"Enable hot module replacement over a Server-Sent Events or WebSocket endpoint.","link":"https://github.com/webpack/webpack-dev-middleware#hot","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"transport":{"description":"How events reach the clients: `sse`, `ws` (needs the optional `ws` dependency and the upgrades of an HTTP server: hand the server to the middleware's `attach(server)`, or pass each upgrade to `handleUpgrade(req, socket, head)`), or a function building a transport of your own.","anyOf":[{"enum":["sse","ws"]},{"instanceof":"Function"}]},"path":{"description":"The path the endpoint is served at. Must start with a slash and carry no query string or fragment.","type":"string","pattern":"^/[^?#]*$"},"heartbeat":{"description":"Heartbeat interval (in milliseconds) used to keep the connection alive.","type":"number","minimum":1},"ws":{"description":"Options for the `ws` server behind the `ws` transport: compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on instead of answering the upgrades it is handed. `path`, `noServer` and `clientTracking` are the middleware's and are ignored here.","link":"https://github.com/webpack/webpack-dev-middleware#hot","type":"object","additionalProperties":true},"progress":{"description":"Publish compilation progress events to the clients.","type":"boolean"},"token":{"description":"A secret the injected client carries and, unless `required` is `false`, the endpoint requires, so reaching the stream takes something a page has to have been given rather than a header the browser may not send. `true` mints one per run, a string uses that one — for a client of your own that has to build the url itself — `false` requires none, and `{ required: false }` hands one to the injected client without requiring it. Defaults to `false`, because requiring one would refuse a client this middleware did not inject; `true` in the next major release.","link":"https://github.com/webpack/webpack-dev-middleware#hottoken","anyOf":[{"type":"boolean"},{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"value":{"description":"The token: `true` (the default) mints one per run, a string uses that one.","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"required":{"description":"Whether the endpoint refuses a client without the token (default `true`). `false` still hands it to the injected client, for a server that checks it itself through `onConnect` alongside policy of its own.","type":"boolean"}}}]},"cors":{"description":"Which origins may read the Server-Sent Events endpoint from a page on another one. Local origins only by default. `true` grants every origin, which lets any site the developer has open read the build's errors, including the source frames webpack puts in them.","link":"https://github.com/webpack/webpack-dev-middleware#hotcors","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"},{"type":"object","additionalProperties":false,"properties":{"origin":{"description":"Which origins may read it, as Vite and `expressjs/cors` are configured.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"}]}}}]},"statsOptions":{"description":"Deprecated, do not use, will be removed in the next major release. Use the `stats` option instead, which decides whether a payload carries errors and warnings.","type":"object","additionalProperties":true},"inject":{"description":"What is added to the compilation: `all` (the default) adds the runtime — this package's client and overlay — and HotModuleReplacementPlugin; `plugin` adds only the plugin, for a page that wires a client of its own; `client` adds only the runtime, for a configuration that applies the plugin itself; `none` adds nothing.","link":"https://github.com/webpack/webpack-dev-middleware#hotinject","enum":["all","plugin","client","none"]},"client":{"description":"Options handed to the browser runtime through its entry query.","link":"https://github.com/webpack/webpack-dev-middleware#hot","$ref":"#/definitions/HotClient"}}}]}},"additionalProperties":false};const schema12 = {"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]};const schema14 = {"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"url":{"description":"Where the runtime connects: a path, an absolute url for an endpoint reached on another origin or through a proxy, or the parts of one that differ, with the rest resolved in the page, which is the only place the rest is known. Defaults to the resolved `hot.path`.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"pageParamPrefix":{"description":"Prefix of the page-url parameters that override `apply` for a single page, as in `?webpack-dev-middleware-hot=false`.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"}}};const func2 = Object.prototype.hasOwnProperty;const pattern0 = new RegExp("^/[^?#]*$", "u");function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!(func2.call(schema11.properties, key0))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.cache !== undefined){let data0 = data.cache;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs5 = errors;for(const key1 in data0){if(!((((key1 === "etag") || (key1 === "lastModified")) || (key1 === "control")) || (key1 === "immutable"))){validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs5 === errors){if(data0.etag !== undefined){let data1 = data0.etag;const _errs6 = errors;if(!((data1 === "weak") || (data1 === "strong"))){validate10.errors = [{instancePath:instancePath+"/cache/etag",schemaPath:"#/properties/cache/properties/etag/enum",keyword:"enum",params:{allowedValues: schema11.properties.cache.properties.etag.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs6 === errors;}else {var valid1 = true;}if(valid1){if(data0.lastModified !== undefined){const _errs7 = errors;if(typeof data0.lastModified !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/lastModified",schemaPath:"#/properties/cache/properties/lastModified/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.control !== undefined){let data3 = data0.control;const _errs9 = errors;const _errs10 = errors;let valid2 = false;const _errs11 = errors;if(typeof data3 !== "boolean"){const err0 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs11 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs13 = errors;if(!(typeof data3 == "number")){const err1 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs13 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs15 = errors;if(errors === _errs15){if(typeof data3 === "string"){if(data3.length < 1){const err2 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs15 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs17 = errors;if(errors === _errs17){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){const _errs19 = errors;for(const key2 in data3){if(!((key2 === "maxAge") || (key2 === "immutable"))){const err4 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;break;}}if(_errs19 === errors){if(data3.maxAge !== undefined){const _errs20 = errors;if(!(typeof data3.maxAge == "number")){const err5 = {instancePath:instancePath+"/cache/control/maxAge",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/maxAge/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var valid3 = _errs20 === errors;}else {var valid3 = true;}if(valid3){if(data3.immutable !== undefined){const _errs22 = errors;if(typeof data3.immutable !== "boolean"){const err6 = {instancePath:instancePath+"/cache/control/immutable",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid3 = _errs22 === errors;}else {var valid3 = true;}}}}else {const err7 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var _valid0 = _errs17 === errors;valid2 = valid2 || _valid0;}}}if(!valid2){const err8 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}var valid1 = _errs9 === errors;}else {var valid1 = true;}if(valid1){if(data0.immutable !== undefined){const _errs24 = errors;if(typeof data0.immutable !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/immutable",schemaPath:"#/properties/cache/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs24 === errors;}else {var valid1 = true;}}}}}}else {validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.mime !== undefined){let data7 = data.mime;const _errs26 = errors;if(errors === _errs26){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){const _errs29 = errors;for(const key3 in data7){if(!((key3 === "types") || (key3 === "default"))){validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs29 === errors){if(data7.types !== undefined){let data8 = data7.types;const _errs30 = errors;if(!(data8 && typeof data8 == "object" && !Array.isArray(data8))){validate10.errors = [{instancePath:instancePath+"/mime/types",schemaPath:"#/properties/mime/properties/types/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid4 = _errs30 === errors;}else {var valid4 = true;}if(valid4){if(data7.default !== undefined){const _errs32 = errors;if(typeof data7.default !== "string"){validate10.errors = [{instancePath:instancePath+"/mime/default",schemaPath:"#/properties/mime/properties/default/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs32 === errors;}else {var valid4 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs26 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypes !== undefined){let data10 = data.mimeTypes;const _errs34 = errors;if(!(data10 && typeof data10 == "object" && !Array.isArray(data10))){validate10.errors = [{instancePath:instancePath+"/mimeTypes",schemaPath:"#/properties/mimeTypes/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid0 = _errs34 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypeDefault !== undefined){const _errs37 = errors;if(typeof data.mimeTypeDefault !== "string"){validate10.errors = [{instancePath:instancePath+"/mimeTypeDefault",schemaPath:"#/properties/mimeTypeDefault/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs37 === errors;}else {var valid0 = true;}if(valid0){if(data.writeToDisk !== undefined){let data12 = data.writeToDisk;const _errs40 = errors;const _errs41 = errors;let valid5 = false;const _errs42 = errors;if(typeof data12 !== "boolean"){const err9 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid1 = _errs42 === errors;valid5 = valid5 || _valid1;if(!valid5){const _errs44 = errors;if(!(data12 instanceof Function)){const err10 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs44 === errors;valid5 = valid5 || _valid1;}if(!valid5){const err11 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}var valid0 = _errs40 === errors;}else {var valid0 = true;}if(valid0){if(data.methods !== undefined){let data13 = data.methods;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data13)){var valid6 = true;const len0 = data13.length;for(let i0=0; i0=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+"/hot/heartbeat",schemaPath:"#/properties/hot/anyOf/1/properties/heartbeat/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}var valid16 = _errs137 === errors;}else {var valid16 = true;}if(valid16){if(data32.ws !== undefined){let data36 = data32.ws;const _errs139 = errors;if(errors === _errs139){if(data36 && typeof data36 == "object" && !Array.isArray(data36)){}else {const err51 = {instancePath:instancePath+"/hot/ws",schemaPath:"#/properties/hot/anyOf/1/properties/ws/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}var valid16 = _errs139 === errors;}else {var valid16 = true;}if(valid16){if(data32.progress !== undefined){const _errs143 = errors;if(typeof data32.progress !== "boolean"){const err52 = {instancePath:instancePath+"/hot/progress",schemaPath:"#/properties/hot/anyOf/1/properties/progress/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}var valid16 = _errs143 === errors;}else {var valid16 = true;}if(valid16){if(data32.token !== undefined){let data38 = data32.token;const _errs145 = errors;const _errs146 = errors;let valid18 = false;const _errs147 = errors;if(typeof data38 !== "boolean"){const err53 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid9 = _errs147 === errors;valid18 = valid18 || _valid9;if(!valid18){const _errs149 = errors;if(errors === _errs149){if(typeof data38 === "string"){if(data38.length < 1){const err54 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}else {const err55 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}var _valid9 = _errs149 === errors;valid18 = valid18 || _valid9;if(!valid18){const _errs151 = errors;if(errors === _errs151){if(data38 && typeof data38 == "object" && !Array.isArray(data38)){const _errs153 = errors;for(const key7 in data38){if(!((key7 === "value") || (key7 === "required"))){const err56 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;break;}}if(_errs153 === errors){if(data38.value !== undefined){let data39 = data38.value;const _errs154 = errors;const _errs155 = errors;let valid20 = false;const _errs156 = errors;if(typeof data39 !== "boolean"){const err57 = {instancePath:instancePath+"/hot/token/value",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/properties/value/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}var _valid10 = _errs156 === errors;valid20 = valid20 || _valid10;if(!valid20){const _errs158 = errors;if(errors === _errs158){if(typeof data39 === "string"){if(data39.length < 1){const err58 = {instancePath:instancePath+"/hot/token/value",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/properties/value/anyOf/1/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}else {const err59 = {instancePath:instancePath+"/hot/token/value",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/properties/value/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}var _valid10 = _errs158 === errors;valid20 = valid20 || _valid10;}if(!valid20){const err60 = {instancePath:instancePath+"/hot/token/value",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/properties/value/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}else {errors = _errs155;if(vErrors !== null){if(_errs155){vErrors.length = _errs155;}else {vErrors = null;}}}var valid19 = _errs154 === errors;}else {var valid19 = true;}if(valid19){if(data38.required !== undefined){const _errs160 = errors;if(typeof data38.required !== "boolean"){const err61 = {instancePath:instancePath+"/hot/token/required",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/properties/required/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}var valid19 = _errs160 === errors;}else {var valid19 = true;}}}}else {const err62 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/2/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}var _valid9 = _errs151 === errors;valid18 = valid18 || _valid9;}}if(!valid18){const err63 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}else {errors = _errs146;if(vErrors !== null){if(_errs146){vErrors.length = _errs146;}else {vErrors = null;}}}var valid16 = _errs145 === errors;}else {var valid16 = true;}if(valid16){if(data32.cors !== undefined){let data41 = data32.cors;const _errs163 = errors;const _errs164 = errors;let valid21 = false;const _errs165 = errors;if(typeof data41 !== "boolean"){const err64 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/properties/hot/anyOf/1/properties/cors/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}var _valid11 = _errs165 === errors;valid21 = valid21 || _valid11;if(!valid21){const _errs167 = errors;const _errs169 = errors;let valid23 = false;const _errs170 = errors;if(errors === _errs170){if(typeof data41 === "string"){if(data41.length < 1){const err65 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}var _valid12 = _errs170 === errors;valid23 = valid23 || _valid12;if(!valid23){const _errs172 = errors;if(!(data41 instanceof RegExp)){const err67 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}var _valid12 = _errs172 === errors;valid23 = valid23 || _valid12;if(!valid23){const _errs173 = errors;if(errors === _errs173){if(Array.isArray(data41)){if(data41.length < 1){const err68 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/2/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}else {var valid24 = true;const len2 = data41.length;for(let i2=0; i2=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/hot/client/connect/retries",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/retries/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}var valid42 = _errs264 === errors;}else {var valid42 = true;}if(valid42){if(data60.timeout !== undefined){let data62 = data60.timeout;const _errs266 = errors;if(errors === _errs266){if(typeof data62 == "number"){if(data62 < 1 || isNaN(data62)){const err129 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}var valid42 = _errs266 === errors;}else {var valid42 = true;}}}}else {const err131 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}var _valid23 = _errs261 === errors;valid41 = valid41 || _valid23;}if(!valid41){const err132 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}else {errors = _errs258;if(vErrors !== null){if(_errs258){vErrors.length = _errs258;}else {vErrors = null;}}}var valid33 = _errs257 === errors;}else {var valid33 = true;}if(valid33){if(data47.pageParamPrefix !== undefined){let data63 = data47.pageParamPrefix;const _errs268 = errors;if(errors === _errs268){if(typeof data63 === "string"){if(data63.length < 1){const err133 = {instancePath:instancePath+"/hot/client/pageParamPrefix",schemaPath:"#/definitions/HotClient/properties/pageParamPrefix/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/hot/client/pageParamPrefix",schemaPath:"#/definitions/HotClient/properties/pageParamPrefix/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}var valid33 = _errs268 === errors;}else {var valid33 = true;}if(valid33){if(data47.logging !== undefined){let data64 = data47.logging;const _errs270 = errors;const _errs271 = errors;let valid43 = false;const _errs272 = errors;if(!((((((data64 === "none") || (data64 === "error")) || (data64 === "warn")) || (data64 === "info")) || (data64 === "log")) || (data64 === "verbose"))){const err135 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}var _valid24 = _errs272 === errors;valid43 = valid43 || _valid24;if(!valid43){const _errs273 = errors;if(errors === _errs273){if(data64 && typeof data64 == "object" && !Array.isArray(data64)){const _errs275 = errors;for(const key12 in data64){if(!((key12 === "level") || (key12 === "name"))){const err136 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;break;}}if(_errs275 === errors){if(data64.level !== undefined){let data65 = data64.level;const _errs276 = errors;if(!((((((data65 === "none") || (data65 === "error")) || (data65 === "warn")) || (data65 === "info")) || (data65 === "log")) || (data65 === "verbose"))){const err137 = {instancePath:instancePath+"/hot/client/logging/level",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/level/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[1].properties.level.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}var valid44 = _errs276 === errors;}else {var valid44 = true;}if(valid44){if(data64.name !== undefined){let data66 = data64.name;const _errs277 = errors;if(errors === _errs277){if(typeof data66 === "string"){if(data66.length < 1){const err138 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}else {const err139 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}var valid44 = _errs277 === errors;}else {var valid44 = true;}}}}else {const err140 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}var _valid24 = _errs273 === errors;valid43 = valid43 || _valid24;}if(!valid43){const err141 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}else {errors = _errs271;if(vErrors !== null){if(_errs271){vErrors.length = _errs271;}else {vErrors = null;}}}var valid33 = _errs270 === errors;}else {var valid33 = true;}if(valid33){if(data47.dynamicPublicPath !== undefined){const _errs279 = errors;if(typeof data47.dynamicPublicPath !== "boolean"){const err142 = {instancePath:instancePath+"/hot/client/dynamicPublicPath",schemaPath:"#/definitions/HotClient/properties/dynamicPublicPath/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}var valid33 = _errs279 === errors;}else {var valid33 = true;}}}}}}}}}}}}else {const err143 = {instancePath:instancePath+"/hot/client",schemaPath:"#/definitions/HotClient/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}var valid16 = _errs208 === errors;}else {var valid16 = true;}}}}}}}}}}}}else {const err144 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}var _valid7 = _errs128 === errors;valid15 = valid15 || _valid7;}if(!valid15){const err145 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs125;if(vErrors !== null){if(_errs125){vErrors.length = _errs125;}else {vErrors = null;}}}var valid0 = _errs124 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;} \ No newline at end of file +/* + * This file was automatically generated by "schema-utils". + * DO NOT MODIFY BY HAND. + */ +"use strict";module.exports=t,module.exports.default=t;let r={definitions:{HotClient:{type:"object",additionalProperties:!1,properties:{transport:{anyOf:[{enum:["sse","ws"]},{type:"string",minLength:1}]},url:{anyOf:[{type:"string",minLength:1},{type:"object",additionalProperties:!1,properties:{protocol:{anyOf:[{enum:["auto"]},{type:"string",minLength:1}]},hostname:{type:"string",minLength:1},port:{anyOf:[{type:"number"},{type:"string",minLength:1}]},pathname:{type:"string"},username:{type:"string"},password:{type:"string"}}}]},name:{type:"string"},overlay:{anyOf:[{type:"boolean"},{type:"object"}]},progress:{anyOf:[{type:"boolean"},{enum:["circular","linear"]}]},apply:{enum:["hmr","hmr-only","reload","nothing"]},connect:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{retries:{type:"number",minimum:0},timeout:{type:"number",minimum:1}}}]},pageParamPrefix:{type:"string",minLength:1},logging:{anyOf:[{enum:["none","error","warn","info","log","verbose"]},{type:"object",additionalProperties:!1,properties:{level:{enum:["none","error","warn","info","log","verbose"]},name:{type:"string",minLength:1}}}]},dynamicPublicPath:{type:"boolean"}}},CorsOrigin:{anyOf:[{type:"string",minLength:1},{instanceof:"RegExp"},{type:"array",items:{anyOf:[{type:"string",minLength:1},{instanceof:"RegExp"}]},minItems:1},{instanceof:"Function"}]}},type:"object",properties:{cache:{type:"object",additionalProperties:!1,properties:{etag:{enum:["weak","strong"]},lastModified:{type:"boolean"},control:{anyOf:[{type:"boolean"},{type:"number"},{type:"string",minLength:1},{type:"object",properties:{maxAge:{type:"number"},immutable:{type:"boolean"}},additionalProperties:!1}]},immutable:{type:"boolean"}}},mime:{type:"object",additionalProperties:!1,properties:{types:{type:"object"},default:{type:"string"}}},mimeTypes:{type:"object"},mimeTypeDefault:{type:"string"},writeToDisk:{anyOf:[{type:"boolean"},{instanceof:"Function"}]},methods:{type:"array",items:{type:"string",minLength:1}},headers:{anyOf:[{type:"array",items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},value:{type:"string"}}},minItems:1},{type:"object"},{instanceof:"Function"}]},publicPath:{anyOf:[{enum:["auto"]},{type:"string"},{instanceof:"Function"}]},stats:{anyOf:[{enum:["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{type:"boolean"},{type:"object",additionalProperties:!0}]},serverSideRender:{type:"boolean"},outputFileSystem:{type:"object"},index:{anyOf:[{type:"boolean"},{type:"string",minLength:1}]},modifyResponseData:{instanceof:"Function"},etag:{enum:["weak","strong"]},lastModified:{type:"boolean"},cacheControl:{anyOf:[{type:"boolean"},{type:"number"},{type:"string",minLength:1},{type:"object",properties:{maxAge:{type:"number"},immutable:{type:"boolean"}},additionalProperties:!1}]},cacheImmutable:{type:"boolean"},forwardError:{type:"boolean"},hot:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{transport:{anyOf:[{enum:["sse","ws"]},{instanceof:"Function"}]},path:{type:"string",pattern:"^/[^?#]*$"},heartbeat:{type:"number",minimum:1},ws:{type:"object",additionalProperties:!0},progress:{type:"boolean"},token:{anyOf:[{type:"boolean"},{type:"string",minLength:1},{type:"object",additionalProperties:!1,properties:{value:{anyOf:[{type:"boolean"},{type:"string",minLength:1}]},required:{type:"boolean"}}}]},cors:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CorsOrigin"},{type:"object",additionalProperties:!1,properties:{origin:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CorsOrigin"}]}}}]},statsOptions:{type:"object",additionalProperties:!0},inject:{enum:["all","plugin","client","none"]},client:{$ref:"#/definitions/HotClient"}}}]}},additionalProperties:!1,$id:"options.json"},e={type:"object",additionalProperties:!1,properties:{transport:{anyOf:[{enum:["sse","ws"]},{type:"string",minLength:1}]},url:{anyOf:[{type:"string",minLength:1},{type:"object",additionalProperties:!1,properties:{protocol:{anyOf:[{enum:["auto"]},{type:"string",minLength:1}]},hostname:{type:"string",minLength:1},port:{anyOf:[{type:"number"},{type:"string",minLength:1}]},pathname:{type:"string"},username:{type:"string"},password:{type:"string"}}}]},name:{type:"string"},overlay:{anyOf:[{type:"boolean"},{type:"object"}]},progress:{anyOf:[{type:"boolean"},{enum:["circular","linear"]}]},apply:{enum:["hmr","hmr-only","reload","nothing"]},connect:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{retries:{type:"number",minimum:0},timeout:{type:"number",minimum:1}}}]},pageParamPrefix:{type:"string",minLength:1},logging:{anyOf:[{enum:["none","error","warn","info","log","verbose"]},{type:"object",additionalProperties:!1,properties:{level:{enum:["none","error","warn","info","log","verbose"]},name:{type:"string",minLength:1}}}]},dynamicPublicPath:{type:"boolean"}}},s=Object.prototype.hasOwnProperty,a=function(r){let e=r.length,s=0,a=0,o;while(a=55296&&o<=56319&&a=",limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"number"}};i===null?i=[r]:i.push(r),n++}var O=e===n}else var O=!0;if(O){if(v.ws!==void 0){let r=v.ws,e=n;if(n===e)if(!(r&&"object"==typeof r&&!Array.isArray(r))){let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var O=e===n}else var O=!0;if(O){if(v.progress!==void 0){let r=n;if("boolean"!=typeof v.progress){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var O=r===n}else var O=!0;if(O){if(v.token!==void 0){let r=v.token,e=n,s=n,o=!1,t=n;if("boolean"!=typeof r){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var w=t===n;if(!(o=o||w)){let e=n;if(n===e)if("string"==typeof r){if(a(r)<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"string"}};i===null?i=[r]:i.push(r),n++}var w=e===n;if(!(o=o||w)){let e=n;if(n===e)if(r&&"object"==typeof r&&!Array.isArray(r)){let e=n;for(let e in r)if(!(e==="value"||e==="required")){let r={params:{additionalProperty:e}};i===null?i=[r]:i.push(r),n++;break}if(e===n){if(r.value!==void 0){let e=r.value,s=n,o=n,t=!1,l=n;if("boolean"!=typeof e){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var x=l===n;if(!(t=t||x)){let r=n;if(n===r)if("string"==typeof e){if(a(e)<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"string"}};i===null?i=[r]:i.push(r),n++}var x=r===n;t=t||x}if(!t){let r={params:{}};i===null?i=[r]:i.push(r),n++}else{n=o;if(i!==null)o?i.length=o:i=null}var L=s===n}else var L=!0;if(L)if(r.required!==void 0){let e=n;if("boolean"!=typeof r.required){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var L=e===n}else var L=!0}}else{let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var w=e===n;o=o||w}}if(!o){let r={params:{}};i===null?i=[r]:i.push(r),n++}else{n=s;if(i!==null)s?i.length=s:i=null}var O=e===n}else var O=!0;if(O){if(v.cors!==void 0){let r=v.cors,e=n,s=n,o=!1,t=n;if("boolean"!=typeof r){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var F=t===n;if(!(o=o||F)){let e=n,s=n,t=!1,l=n;if(n===l)if("string"==typeof r){if(a(r)<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"string"}};i===null?i=[r]:i.push(r),n++}var R=l===n;if(!(t=t||R)){let e=n;if(!(r instanceof RegExp)){let r={params:{}};i===null?i=[r]:i.push(r),n++}var R=e===n;if(!(t=t||R)){let e=n;if(n===e)if(Array.isArray(r))if(r.length<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}else{var D=!0;let e=r.length;for(let s=0;s=",limit:0}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"number"}};i===null?i=[r]:i.push(r),n++}var K=s===n}else var K=!0;if(K)if(e.timeout!==void 0){let r=e.timeout,s=n;if(n===s)if("number"==typeof r){if(r<1||isNaN(r)){let r={params:{comparison:">=",limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"number"}};i===null?i=[r]:i.push(r),n++}var K=s===n}else var K=!0}}else{let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var J=r===n;o=o||J}if(!o){let r={params:{}};i===null?i=[r]:i.push(r),n++}else{n=a;if(i!==null)a?i.length=a:i=null}var N=s===n}else var N=!0;if(N){if(r.pageParamPrefix!==void 0){let e=r.pageParamPrefix,s=n;if(n===s)if("string"==typeof e){if(a(e)<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"string"}};i===null?i=[r]:i.push(r),n++}var N=s===n}else var N=!0;if(N){if(r.logging!==void 0){let s=r.logging,o=n,t=n,l=!1,v=n;if(!(s==="none"||s==="error"||s==="warn"||s==="info"||s==="log"||s==="verbose")){let r={params:{allowedValues:e.properties.logging.anyOf[0].enum}};i===null?i=[r]:i.push(r),n++}var Q=v===n;if(!(l=l||Q)){let r=n;if(n===r)if(s&&"object"==typeof s&&!Array.isArray(s)){let r=n;for(let r in s)if(!(r==="level"||r==="name")){let e={params:{additionalProperty:r}};i===null?i=[e]:i.push(e),n++;break}if(r===n){if(s.level!==void 0){let r=s.level,a=n;if(!(r==="none"||r==="error"||r==="warn"||r==="info"||r==="log"||r==="verbose")){let r={params:{allowedValues:e.properties.logging.anyOf[1].properties.level.enum}};i===null?i=[r]:i.push(r),n++}var U=a===n}else var U=!0;if(U)if(s.name!==void 0){let r=s.name,e=n;if(n===e)if("string"==typeof r){if(a(r)<1){let r={params:{limit:1}};i===null?i=[r]:i.push(r),n++}}else{let r={params:{type:"string"}};i===null?i=[r]:i.push(r),n++}var U=e===n}else var U=!0}}else{let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var Q=r===n;l=l||Q}if(!l){let r={params:{}};i===null?i=[r]:i.push(r),n++}else{n=t;if(i!==null)t?i.length=t:i=null}var N=o===n}else var N=!0;if(N)if(r.dynamicPublicPath!==void 0){let e=n;if("boolean"!=typeof r.dynamicPublicPath){let r={params:{type:"boolean"}};i===null?i=[r]:i.push(r),n++}var N=e===n}else var N=!0}}}}}}}}}}else{let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var O=o===n}else var O=!0}}}}}}}}}}else{let r={params:{type:"object"}};i===null?i=[r]:i.push(r),n++}var A=t===n;u=u||A}if(!u){let r={params:{}};i===null?i=[r]:i.push(r),n++,t.errors=i;return!1}n=f;if(i!==null)f?i.length=f:i=null;var p=d===n}else var p=!0}}}}}}}}}}}}}}}}}}}else return t.errors=[{params:{type:"object"}}],!1;return t.errors=i,n===0} diff --git a/test/__snapshots__/logging.test.js.snap.webpack5 b/test/__snapshots__/logging.test.js.snap.webpack5 index eb22e9a5b..b57a25c45 100644 --- a/test/__snapshots__/logging.test.js.snap.webpack5 +++ b/test/__snapshots__/logging.test.js.snap.webpack5 @@ -255,9 +255,6 @@ runtime modules x KiB webpack/runtime/define property getters x bytes {main} [code generated] [no exports] [used exports unknown] -webpack/runtime/global x bytes {main} [code generated] -[no exports] -[used exports unknown] webpack/runtime/hasOwnProperty shorthand x bytes {main} [code generated] [no exports] [used exports unknown] @@ -855,9 +852,6 @@ runtime modules x KiB webpack/runtime/define property getters x bytes {main} [code generated] [no exports] [used exports unknown] -webpack/runtime/global x bytes {main} [code generated] -[no exports] -[used exports unknown] webpack/runtime/hasOwnProperty shorthand x bytes {main} [code generated] [no exports] [used exports unknown] @@ -968,9 +962,6 @@ runtime modules x KiB webpack/runtime/define property getters x bytes {main} [code generated] [no exports] [used exports unknown] -webpack/runtime/global x bytes {main} [code generated] -[no exports] -[used exports unknown] webpack/runtime/hasOwnProperty shorthand x bytes {main} [code generated] [no exports] [used exports unknown] diff --git a/types/options.check.d.ts b/types/options.check.d.ts index 5ac7f59b6..b490078d8 100644 --- a/types/options.check.d.ts +++ b/types/options.check.d.ts @@ -1,6 +1,6 @@ -export = validate10; -declare function validate10( - data: any, +export = t; +declare function t( + l: any, { instancePath, parentData, @@ -11,6 +11,6 @@ declare function validate10( rootData?: any; }, ): boolean; -declare namespace validate10 { - export { validate10 as default }; +declare namespace t { + export { t as default }; }