html-validate 9.0.0-rc.7 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core-nodejs.js +14 -9
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +39 -188
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +30 -10
- package/dist/cjs/elements.js.map +1 -1
- package/dist/cjs/test-utils.js +8 -1
- package/dist/cjs/test-utils.js.map +1 -1
- package/dist/es/core-nodejs.js +17 -10
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +39 -188
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +30 -10
- package/dist/es/elements.js.map +1 -1
- package/dist/es/test-utils.js +8 -1
- package/dist/es/test-utils.js.map +1 -1
- package/dist/schema/config.json +2 -2
- package/dist/schema/elements.json +2 -35
- package/dist/types/browser.d.ts +55 -21
- package/dist/types/index.d.ts +55 -21
- package/dist/types/test-utils.d.ts +12 -8
- package/package.json +1 -1
package/dist/cjs/test-utils.js
CHANGED
|
@@ -6,6 +6,9 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
6
6
|
|
|
7
7
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
8
8
|
|
|
9
|
+
function isIterable(value) {
|
|
10
|
+
return Symbol.iterator in value;
|
|
11
|
+
}
|
|
9
12
|
function transformFile(fn, filename, chain) {
|
|
10
13
|
const data = fs__default.default.readFileSync(filename, "utf-8");
|
|
11
14
|
const source = {
|
|
@@ -37,7 +40,11 @@ async function transformSource(fn, source, chain) {
|
|
|
37
40
|
chain: chain ?? defaultChain
|
|
38
41
|
};
|
|
39
42
|
const result = await fn.call(context, source);
|
|
40
|
-
|
|
43
|
+
if (isIterable(result)) {
|
|
44
|
+
return await Promise.all(Array.from(result));
|
|
45
|
+
} else {
|
|
46
|
+
return [result];
|
|
47
|
+
}
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
exports.transformFile = transformFile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sources":["../../src/transform/test-utils.ts"],"sourcesContent":["import fs from \"fs\";\nimport {
|
|
1
|
+
{"version":3,"file":"test-utils.js","sources":["../../src/transform/test-utils.ts"],"sourcesContent":["import fs from \"fs\";\nimport {\n\ttype Source,\n\ttype TransformContext,\n\ttype Transformer,\n\ttype TransformerChainedResult,\n} from \"html-validate\";\n\n/* eslint-disable-next-line import/no-extraneous-dependencies -- this is the package itself */\nexport {\n\ttype Source,\n\ttype Transformer,\n\ttype TransformerResult,\n\ttype TransformerChainedResult,\n} from \"html-validate\";\n\nfunction isIterable(\n\tvalue: Source | Iterable<Source | Promise<Source>>,\n): value is Iterable<Source | Promise<Source>> {\n\treturn Symbol.iterator in value;\n}\n\n/**\n * Helper function to call a transformer function in test-cases.\n *\n * @public\n * @param fn - Transformer function to call.\n * @param filename - Filename to read data from. Must be readable.\n * @param chain - If set this function is called when chaining transformers. Default is pass-thru.\n */\nexport function transformFile(\n\tfn: Transformer,\n\tfilename: string,\n\tchain?: (source: Source, filename: string) => TransformerChainedResult,\n): Promise<Source[]> {\n\tconst data = fs.readFileSync(filename, \"utf-8\");\n\tconst source: Source = {\n\t\tfilename,\n\t\tline: 1,\n\t\tcolumn: 1,\n\t\toffset: 0,\n\t\tdata,\n\t};\n\treturn transformSource(fn, source, chain);\n}\n\n/**\n * Helper function to call a transformer function in test-cases.\n *\n * @public\n * @param fn - Transformer function to call.\n * @param data - String to transform.\n * @param chain - If set this function is called when chaining transformers. Default is pass-thru.\n */\nexport function transformString(\n\tfn: Transformer,\n\tdata: string,\n\tchain?: (source: Source, filename: string) => TransformerChainedResult,\n): Promise<Source[]> {\n\tconst source: Source = {\n\t\tfilename: \"inline\",\n\t\tline: 1,\n\t\tcolumn: 1,\n\t\toffset: 0,\n\t\tdata,\n\t};\n\treturn transformSource(fn, source, chain);\n}\n\n/**\n * Helper function to call a transformer function in test-cases.\n *\n * @public\n * @param fn - Transformer function to call.\n * @param data - Source to transform.\n * @param chain - If set this function is called when chaining transformers. Default is pass-thru.\n */\nexport async function transformSource(\n\tfn: Transformer,\n\tsource: Source,\n\tchain?: (source: Source, filename: string) => TransformerChainedResult,\n): Promise<Source[]> {\n\tconst defaultChain = (source: Source): Iterable<Source> => [source];\n\tconst context: TransformContext = {\n\t\thasChain: /* istanbul ignore next */ () => true,\n\t\tchain: chain ?? defaultChain,\n\t};\n\tconst result = await fn.call(context, source);\n\tif (isIterable(result)) {\n\t\treturn await Promise.all(Array.from(result));\n\t} else {\n\t\treturn [result];\n\t}\n}\n"],"names":["fs","source"],"mappings":";;;;;;;;AAgBA,SAAS,WACR,KAC8C,EAAA;AAC9C,EAAA,OAAO,OAAO,QAAY,IAAA,KAAA;AAC3B;AAUgB,SAAA,aAAA,CACf,EACA,EAAA,QAAA,EACA,KACoB,EAAA;AACpB,EAAA,MAAM,IAAO,GAAAA,mBAAA,CAAG,YAAa,CAAA,QAAA,EAAU,OAAO,CAAA;AAC9C,EAAA,MAAM,MAAiB,GAAA;AAAA,IACtB,QAAA;AAAA,IACA,IAAM,EAAA,CAAA;AAAA,IACN,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,CAAA;AAAA,IACR;AAAA,GACD;AACA,EAAO,OAAA,eAAA,CAAgB,EAAI,EAAA,MAAA,EAAQ,KAAK,CAAA;AACzC;AAUgB,SAAA,eAAA,CACf,EACA,EAAA,IAAA,EACA,KACoB,EAAA;AACpB,EAAA,MAAM,MAAiB,GAAA;AAAA,IACtB,QAAU,EAAA,QAAA;AAAA,IACV,IAAM,EAAA,CAAA;AAAA,IACN,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,CAAA;AAAA,IACR;AAAA,GACD;AACA,EAAO,OAAA,eAAA,CAAgB,EAAI,EAAA,MAAA,EAAQ,KAAK,CAAA;AACzC;AAUsB,eAAA,eAAA,CACrB,EACA,EAAA,MAAA,EACA,KACoB,EAAA;AACpB,EAAA,MAAM,YAAe,GAAA,CAACC,OAAqC,KAAA,CAACA,OAAM,CAAA;AAClE,EAAA,MAAM,OAA4B,GAAA;AAAA,IACjC,QAAA;AAAA;AAAA,MAAqC,MAAM;AAAA,KAAA;AAAA,IAC3C,OAAO,KAAS,IAAA;AAAA,GACjB;AACA,EAAA,MAAM,MAAS,GAAA,MAAM,EAAG,CAAA,IAAA,CAAK,SAAS,MAAM,CAAA;AAC5C,EAAI,IAAA,UAAA,CAAW,MAAM,CAAG,EAAA;AACvB,IAAA,OAAO,MAAM,OAAQ,CAAA,GAAA,CAAI,KAAM,CAAA,IAAA,CAAK,MAAM,CAAC,CAAA;AAAA,GACrC,MAAA;AACN,IAAA,OAAO,CAAC,MAAM,CAAA;AAAA;AAEhB;;;;;;"}
|
package/dist/es/core-nodejs.js
CHANGED
|
@@ -22,7 +22,9 @@ function requireUncached(require, moduleId) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const legacyRequire = createRequire(import.meta.url);
|
|
25
|
-
const importResolve =
|
|
25
|
+
const importResolve = (specifier) => {
|
|
26
|
+
return new URL(import.meta.resolve(specifier));
|
|
27
|
+
};
|
|
26
28
|
|
|
27
29
|
let cachedRootDir = null;
|
|
28
30
|
function determineRootDirImpl(intial, fs2) {
|
|
@@ -55,7 +57,7 @@ function expandRelativePath(value, { cwd }) {
|
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
function isRequireError
|
|
60
|
+
function isRequireError(error) {
|
|
59
61
|
return Boolean(error && typeof error === "object" && "code" in error);
|
|
60
62
|
}
|
|
61
63
|
function isTransformer$1(value) {
|
|
@@ -72,7 +74,7 @@ function cjsResolver(options = {}) {
|
|
|
72
74
|
return requireUncached(legacyRequire, moduleName);
|
|
73
75
|
}
|
|
74
76
|
} catch (err) {
|
|
75
|
-
if (isRequireError
|
|
77
|
+
if (isRequireError(err) && err.code === "MODULE_NOT_FOUND") {
|
|
76
78
|
return null;
|
|
77
79
|
}
|
|
78
80
|
throw err;
|
|
@@ -125,20 +127,25 @@ function nodejsResolver(options = {}) {
|
|
|
125
127
|
return cjsResolver(options);
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
function importFunction(id) {
|
|
131
|
+
return import(id);
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
async function getModuleName(id, { cache, rootDir }) {
|
|
129
135
|
const moduleName = id.replace("<rootDir>", rootDir);
|
|
130
|
-
const url =
|
|
136
|
+
const url = importResolve(moduleName);
|
|
131
137
|
if (url.protocol !== "file:") {
|
|
132
138
|
return url;
|
|
133
139
|
}
|
|
134
140
|
if (cache) {
|
|
135
141
|
return url;
|
|
142
|
+
} else {
|
|
143
|
+
const stat = await fs$1.stat(url);
|
|
144
|
+
url.searchParams.append("mtime", String(stat.mtime.getTime()));
|
|
145
|
+
return url;
|
|
136
146
|
}
|
|
137
|
-
const stat = await fs$1.stat(url);
|
|
138
|
-
url.searchParams.append("mtime", String(stat.mtime.getTime()));
|
|
139
|
-
return url;
|
|
140
147
|
}
|
|
141
|
-
function
|
|
148
|
+
function isImportError(error) {
|
|
142
149
|
return Boolean(error && typeof error === "object" && "code" in error);
|
|
143
150
|
}
|
|
144
151
|
async function internalImport(id, rootDir, { cache }) {
|
|
@@ -152,13 +159,13 @@ async function internalImport(id, rootDir, { cache }) {
|
|
|
152
159
|
return null;
|
|
153
160
|
}
|
|
154
161
|
const moduleName = fileURLToPath(url);
|
|
155
|
-
const { default: defaultImport } = await
|
|
162
|
+
const { default: defaultImport } = await importFunction(moduleName);
|
|
156
163
|
if (!defaultImport) {
|
|
157
164
|
throw new UserError(`"${id}" does not have a default export`);
|
|
158
165
|
}
|
|
159
166
|
return defaultImport;
|
|
160
167
|
} catch (err) {
|
|
161
|
-
if (
|
|
168
|
+
if (isImportError(err) && err.code === "MODULE_NOT_FOUND" && !err.requireStack) {
|
|
162
169
|
return null;
|
|
163
170
|
}
|
|
164
171
|
throw err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-nodejs.js","sources":["../../src/utils/require-uncached.ts","../../src/config/resolver/nodejs/determine-root-dir.ts","../../src/config/resolver/nodejs/expand-relative-path.ts","../../src/config/resolver/nodejs/cjs-resolver.ts","../../src/config/resolver/nodejs/internal-import.ts","../../src/config/resolver/nodejs/esm-resolver.ts","../../src/config/loaders/file-system.ts","../../src/utils/compatibility-check.nodejs.ts"],"sourcesContent":["/**\n * Similar to `require(..)` but removes the cached copy first.\n */\nexport function requireUncached(require: NodeJS.Require, moduleId: string): unknown {\n\tconst filename = require.resolve(moduleId);\n\n\t/* remove references from the parent module to prevent memory leak */\n\tconst m = require.cache[filename];\n\tif (m?.parent) {\n\t\tconst { parent } = m;\n\t\tfor (let i = parent.children.length - 1; i >= 0; i--) {\n\t\t\tif (parent.children[i].id === filename) {\n\t\t\t\tparent.children.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* remove old module from cache */\n\t/* eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- needed to perform its function */\n\tdelete require.cache[filename];\n\n\t/* eslint-disable-next-line import/no-dynamic-require, security/detect-non-literal-require -- as expected but should be moved to upcoming resolver class */\n\treturn require(filename);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nlet cachedRootDir: string | null = null;\n\ninterface FSLike {\n\texistsSync(path: string): boolean;\n}\n\n/**\n * @internal\n */\nexport function determineRootDirImpl(intial: string, fs: FSLike): string {\n\t/* try to locate package.json */\n\tlet current = intial;\n\n\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- break outs when filesystem is traversed\n\twhile (true) {\n\t\tconst search = path.join(current, \"package.json\");\n\t\tif (fs.existsSync(search)) {\n\t\t\treturn current;\n\t\t}\n\n\t\t/* get the parent directory */\n\t\tconst child = current;\n\t\tcurrent = path.dirname(current);\n\n\t\t/* stop if this is the root directory */\n\t\tif (current === child) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* default to working directory if no package.json is found */\n\treturn intial;\n}\n\n/**\n * Try to determine root directory based on the location of the closest\n * `package.json`. Fallbacks on `process.cwd()` if no package.json was found.\n *\n * @internal\n */\n/* istanbul ignore next: cached version of determineRootDirImpl, no need to test */\nexport function determineRootDir(): string {\n\tif (cachedRootDir === null) {\n\t\tcachedRootDir = determineRootDirImpl(process.cwd(), fs);\n\t}\n\treturn cachedRootDir;\n}\n","import path from \"node:path\";\n\n/**\n * @internal\n */\nexport function expandRelativePath<T>(value: string | T, { cwd }: { cwd: string }): string | T {\n\tif (typeof value === \"string\" && value.startsWith(\".\")) {\n\t\treturn path.normalize(path.join(cwd, value));\n\t} else {\n\t\treturn value;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { legacyRequire } from \"../../../resolve\";\nimport { type Transformer } from \"../../../transform\";\nimport { requireUncached } from \"../../../utils\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\n\n/**\n * @internal\n */\nexport interface RequireError extends Error {\n\tcode: string;\n}\n\nfunction isRequireError(error: unknown): error is RequireError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @since 8.8.0\n */\nexport type CommonJSResolver = Required<Resolver>;\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @deprecated Deprecated alias for [[CommonJSResolver]].\n * @since 8.0.0\n */\nexport type NodeJSResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 8.8.0\n */\nexport function cjsResolver(options: { rootDir?: string } = {}): CommonJSResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\tfunction internalRequire<T = unknown>(id: string, { cache }: ResolverOptions): T | null {\n\t\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\t\ttry {\n\t\t\t/* istanbul ignore else: the tests only runs the cached versions to get\n\t\t\t * unmodified access to `require`, the implementation of `requireUncached`\n\t\t\t * is assumed to be tested elsewhere */\n\t\t\tif (cache) {\n\t\t\t\treturn legacyRequire(moduleName) as T;\n\t\t\t} else {\n\t\t\t\treturn requireUncached(legacyRequire, moduleName) as T;\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tif (isRequireError(err) && err.code === \"MODULE_NOT_FOUND\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"nodejs-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): MetaDataTable | null {\n\t\t\treturn internalRequire(id, options);\n\t\t},\n\n\t\tresolveConfig(id: string, options: ResolverOptions): ConfigData | null {\n\t\t\tconst configData = internalRequire<ConfigData>(id, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Plugin | null {\n\t\t\treturn internalRequire<Plugin>(id, options);\n\t\t},\n\n\t\tresolveTransformer(id: string, options: ResolverOptions): Transformer | null {\n\t\t\tconst mod = internalRequire<Transformer | Plugin>(id, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @deprecated Deprecated alias for [[commonjsResolver]].\n * @since 8.0.0\n */\n/* istanbul ignore next -- deprecated alias */\nexport function nodejsResolver(options: { rootDir?: string } = {}): NodeJSResolver {\n\treturn cjsResolver(options);\n}\n","import fs from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport { importResolve } from \"../../../resolve\";\nimport { UserError } from \"../../../error\";\nimport { type ResolverOptions } from \"../resolver\";\n\ninterface RequireError extends Error {\n\tcode: string;\n\trequireStack?: string[];\n}\n\nasync function getModuleName(\n\tid: string,\n\t{ cache, rootDir }: { cache: boolean; rootDir: string },\n): Promise<URL> {\n\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\n\tconst url = new URL(importResolve(moduleName));\n\n\tif (url.protocol !== \"file:\") {\n\t\treturn url;\n\t}\n\n\t/* istanbul ignore next: the tests only runs the cached versions */\n\tif (cache) {\n\t\treturn url;\n\t}\n\n\t/* Cachebusting in ESM is tricky, we cannot flush the cache of the old import\n\t * but a common workaround is to append ?something to the path. It only works\n\t * with absolute paths though so we must first use `import.meta.resolve(..)`\n\t * which doesn't play nice with CJS. Then we will leak memory each time a\n\t * fresh copy is loaded and there doesn't seem to be a way to deal with this\n\t * yet. We use the file mtime to at least try to retain the copy as long as\n\t * possible but this will fail for transitive imports but at least with\n\t * directly loaded configurations it would reload property. */\n\tconst stat = await fs.stat(url);\n\turl.searchParams.append(\"mtime\", String(stat.mtime.getTime()));\n\treturn url;\n}\n\nfunction isRequireError(error: unknown): error is RequireError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\nexport async function internalImport<T = unknown>(\n\tid: string,\n\trootDir: string,\n\t{ cache }: ResolverOptions,\n): Promise<T | null> {\n\t/* this is a workaround for rollup which mangles import attributes so we\n\t * cannot use `import(.., { with: { type: \"json\" } })` to import a json\n\t * file. */\n\tif (id.endsWith(\".json\")) {\n\t\tconst content = await fs.readFile(id, \"utf-8\");\n\t\treturn JSON.parse(content) as T;\n\t}\n\n\ttry {\n\t\tconst url = await getModuleName(id, { cache, rootDir });\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst moduleName = fileURLToPath(url);\n\n\t\tconst { default: defaultImport } = (await import(moduleName)) as { default: T };\n\t\tif (!defaultImport) {\n\t\t\tthrow new UserError(`\"${id}\" does not have a default export`);\n\t\t}\n\t\treturn defaultImport;\n\t} catch (err: unknown) {\n\t\tif (isRequireError(err) && err.code === \"MODULE_NOT_FOUND\" && !err.requireStack) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow err;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { type Transformer } from \"../../../transform\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\nimport { internalImport } from \"./internal-import\";\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * ESM resolver.\n *\n * @public\n * @since 9.0.0-rc.4\n */\nexport type ESMResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `import(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 9.0.0-rc.4\n */\nexport function esmResolver(options: { rootDir?: string } = {}): ESMResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\treturn {\n\t\tname: \"esm-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): Promise<MetaDataTable | null> {\n\t\t\treturn internalImport(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveConfig(id: string, options: ResolverOptions): Promise<ConfigData | null> {\n\t\t\tconst configData = await internalImport<ConfigData>(id, rootDir, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Promise<Plugin | null> {\n\t\t\treturn internalImport<Plugin>(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveTransformer(id: string, options: ResolverOptions): Promise<Transformer | null> {\n\t\t\tconst mod = await internalImport<Transformer | Plugin>(id, rootDir, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Config } from \"../config\";\nimport { type ConfigData } from \"../config-data\";\nimport { ConfigLoader } from \"../config-loader\";\nimport { type ResolvedConfig } from \"../resolved-config\";\nimport { type Resolver } from \"../resolver\";\nimport { type FSLike, esmResolver } from \"../resolver/nodejs\";\nimport { isThenable } from \"../../utils\";\n\n/**\n * Options for [[FileSystemConfigLoader]].\n *\n * @public\n */\nexport interface FileSystemConfigLoaderOptions {\n\t/** An implementation of `fs` as needed by [[FileSystemConfigLoader]] */\n\tfs: FSLike;\n}\n\n/**\n * @internal\n */\nfunction findConfigurationFiles(fs: FSLike, directory: string): string[] {\n\treturn [\"json\", \"mjs\", \"cjs\", \"js\"]\n\t\t.map((extension) => path.join(directory, `.htmlvalidate.${extension}`))\n\t\t.filter((filePath) => fs.existsSync(filePath));\n}\n\nconst defaultResolvers: Resolver[] = [esmResolver()];\n\ntype ConstructorParametersDefault = [ConfigData?, Partial<FileSystemConfigLoaderOptions>?];\ntype ConstructorParametersResolver = [\n\tResolver[],\n\tConfigData?,\n\tPartial<FileSystemConfigLoaderOptions>?,\n];\ntype ConstructorParameters = ConstructorParametersDefault | ConstructorParametersResolver;\n\nfunction hasResolver(value: ConstructorParameters): value is ConstructorParametersResolver {\n\treturn Array.isArray(value[0]);\n}\n\n/**\n * Loads configuration by traversing filesystem.\n *\n * Configuration is read from three sources and in the following order:\n *\n * 1. Global configuration passed to constructor.\n * 2. Configuration files found when traversing the directory structure.\n * 3. Override passed to this function.\n *\n * The following configuration filenames are searched:\n *\n * - `.htmlvalidate.json`\n * - `.htmlvalidate.js`\n * - `.htmlvalidate.cjs`\n * - `.htmlvalidate.mjs`\n *\n * Global configuration is used when no configuration file is found. The\n * result is always merged with override if present.\n *\n * The `root` property set to `true` affects the configuration as following:\n *\n * 1. If set in override the override is returned as-is.\n * 2. If set in the global config the override is merged into global and\n * returned. No configuration files are searched.\n * 3. Setting `root` in configuration file only stops directory traversal.\n *\n * @public\n */\nexport class FileSystemConfigLoader extends ConfigLoader {\n\tprotected cache: Map<string, Config | null>;\n\tprivate fs: FSLike;\n\n\t/**\n\t * Create a filesystem configuration loader with default resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(config?: ConfigData, options?: Partial<FileSystemConfigLoaderOptions>);\n\n\t/**\n\t * Create a filesystem configuration loader with custom resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param resolvers - Resolvers to use.\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(\n\t\tresolvers: Resolver[],\n\t\tconfig?: ConfigData,\n\t\toptions?: Partial<FileSystemConfigLoaderOptions>,\n\t);\n\n\tpublic constructor(...args: ConstructorParameters) {\n\t\tif (hasResolver(args)) {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [resolvers, config, options = {}] = args;\n\t\t\tsuper(resolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t} else {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [config, options = {}] = args;\n\t\t\tsuper(defaultResolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t}\n\t\tthis.cache = new Map();\n\t}\n\n\t/**\n\t * Get configuration for given filename.\n\t *\n\t * @param filename - Filename to get configuration for.\n\t * @param configOverride - Configuration to merge final result with.\n\t */\n\tpublic override getConfigFor(\n\t\tfilename: string,\n\t\tconfigOverride?: ConfigData,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst override = this.loadFromObject(configOverride ?? {});\n\t\tif (isThenable(override)) {\n\t\t\treturn override.then((override) => {\n\t\t\t\treturn this._resolveAsync(filename, override);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync1(filename, override);\n\t\t}\n\t}\n\n\t/**\n\t * Flush configuration cache.\n\t *\n\t * @param filename - If given only the cache for that file is flushed.\n\t */\n\tpublic override flushCache(filename?: string): void {\n\t\tif (filename) {\n\t\t\tthis.cache.delete(filename);\n\t\t} else {\n\t\t\tthis.cache.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Load raw configuration from directory traversal.\n\t *\n\t * This configuration is not merged with global configuration and may return\n\t * `null` if no configuration files are found.\n\t */\n\tpublic fromFilename(filename: string): Config | Promise<Config | null> | null {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = this.loadFromFile(configFile);\n\n\t\t\t\t/* if the loader returns an async config we exit out of the synchronous\n\t\t\t\t * processing and enter the async method so we can resolve any promises\n\t\t\t\t * as we go */\n\t\t\t\tif (isThenable(local)) {\n\t\t\t\t\treturn this.fromFilenameAsync(filename);\n\t\t\t\t}\n\n\t\t\t\tfound = true;\n\n\t\t\t\tconst merged = local.merge(this.resolvers, config);\n\t\t\t\tif (isThenable(merged)) {\n\t\t\t\t\tthrow new Error(\"internal error: async result ended up in sync path\");\n\t\t\t\t}\n\t\t\t\tconfig = merged;\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\t/**\n\t * Async version of [[fromFilename]].\n\t *\n\t * @internal\n\t */\n\tpublic async fromFilenameAsync(filename: string): Promise<Config | null> {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = await this.loadFromFile(configFile);\n\t\t\t\tfound = true;\n\t\t\t\tconfig = await local.merge(this.resolvers, config);\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\tprivate _merge(\n\t\tglobalConfig: Config,\n\t\toverride: Config,\n\t\tconfig: Config | null,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst merged = config\n\t\t\t? config.merge(this.resolvers, override)\n\t\t\t: globalConfig.merge(this.resolvers, override);\n\t\tif (isThenable(merged)) {\n\t\t\treturn merged.then((merged) => {\n\t\t\t\treturn merged.resolve();\n\t\t\t});\n\t\t} else {\n\t\t\treturn merged.resolve();\n\t\t}\n\t}\n\n\tprivate _resolveSync1(\n\t\tfilename: string,\n\t\toverride: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = this.getGlobalConfig();\n\t\tif (isThenable(globalConfig)) {\n\t\t\treturn globalConfig.then((globalConfig) => {\n\t\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t}\n\t}\n\n\tprivate _resolveSync2(\n\t\tfilename: string,\n\t\toverride: Config,\n\t\tglobalConfig: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = globalConfig.merge(this.resolvers, override);\n\t\t\tif (isThenable(merged)) {\n\t\t\t\treturn merged.then((merged) => {\n\t\t\t\t\treturn merged.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn merged.resolve();\n\t\t\t}\n\t\t}\n\n\t\tconst config = this.fromFilename(filename);\n\t\tif (isThenable(config)) {\n\t\t\treturn config.then((config) => {\n\t\t\t\treturn this._merge(globalConfig, override, config);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._merge(globalConfig, override, config);\n\t\t}\n\t}\n\n\tprivate async _resolveAsync(filename: string, override: Config): Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = await this.getGlobalConfig();\n\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = await globalConfig.merge(this.resolvers, override);\n\t\t\treturn merged.resolve();\n\t\t}\n\n\t\tconst config = await this.fromFilenameAsync(filename);\n\t\treturn this._merge(globalConfig, override, config);\n\t}\n\n\t/**\n\t * @internal For testing only\n\t */\n\tpublic _getInternalCache(): Map<string, Config | null> {\n\t\treturn this.cache;\n\t}\n\n\tprotected defaultConfig(): Config | Promise<Config> {\n\t\treturn Config.defaultConfig();\n\t}\n}\n","import kleur from \"kleur\";\nimport { version } from \"../generated/package\";\nimport { type CompatibilityOptions, compatibilityCheckImpl } from \"./compatibility-check\";\n\nconst defaults: CompatibilityOptions = {\n\tsilent: false,\n\tversion,\n\tlogger(text: string): void {\n\t\t/* eslint-disable-next-line no-console -- expected to log */\n\t\tconsole.error(kleur.red(text));\n\t},\n};\n\n/**\n * Tests if plugin is compatible with html-validate library. Unless the `silent`\n * option is used a warning is displayed on the console.\n *\n * @public\n * @since v5.0.0\n * @param name - Name of plugin\n * @param declared - What library versions the plugin support (e.g. declared peerDependencies)\n * @returns - `true` if version is compatible\n */\nexport function compatibilityCheck(\n\tname: string,\n\tdeclared: string,\n\toptions?: Partial<CompatibilityOptions>,\n): boolean {\n\treturn compatibilityCheckImpl(name, declared, {\n\t\t...defaults,\n\t\t...options,\n\t});\n}\n"],"names":["fs","isRequireError","isTransformer","options","override","merged","globalConfig","config"],"mappings":";;;;;;;;AAGgB,SAAA,eAAA,CAAgB,SAAyB,QAA2B,EAAA;AACnF,EAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,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AU,EAAA;AAAA,IAC7C,GAAG,QAAA;AAAA,IACH,GAAG;AAAA,GACH,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"core-nodejs.js","sources":["../../src/utils/require-uncached.ts","../../src/config/resolver/nodejs/determine-root-dir.ts","../../src/config/resolver/nodejs/expand-relative-path.ts","../../src/config/resolver/nodejs/cjs-resolver.ts","../../src/config/resolver/nodejs/import-function.ts","../../src/config/resolver/nodejs/internal-import.ts","../../src/config/resolver/nodejs/esm-resolver.ts","../../src/config/loaders/file-system.ts","../../src/utils/compatibility-check.nodejs.ts"],"sourcesContent":["/**\n * Similar to `require(..)` but removes the cached copy first.\n */\nexport function requireUncached(require: NodeJS.Require, moduleId: string): unknown {\n\tconst filename = require.resolve(moduleId);\n\n\t/* remove references from the parent module to prevent memory leak */\n\tconst m = require.cache[filename];\n\tif (m?.parent) {\n\t\tconst { parent } = m;\n\t\tfor (let i = parent.children.length - 1; i >= 0; i--) {\n\t\t\tif (parent.children[i].id === filename) {\n\t\t\t\tparent.children.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* remove old module from cache */\n\t/* eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- needed to perform its function */\n\tdelete require.cache[filename];\n\n\t/* eslint-disable-next-line import/no-dynamic-require, security/detect-non-literal-require -- as expected but should be moved to upcoming resolver class */\n\treturn require(filename);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nlet cachedRootDir: string | null = null;\n\ninterface FSLike {\n\texistsSync(path: string): boolean;\n}\n\n/**\n * @internal\n */\nexport function determineRootDirImpl(intial: string, fs: FSLike): string {\n\t/* try to locate package.json */\n\tlet current = intial;\n\n\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- break outs when filesystem is traversed\n\twhile (true) {\n\t\tconst search = path.join(current, \"package.json\");\n\t\tif (fs.existsSync(search)) {\n\t\t\treturn current;\n\t\t}\n\n\t\t/* get the parent directory */\n\t\tconst child = current;\n\t\tcurrent = path.dirname(current);\n\n\t\t/* stop if this is the root directory */\n\t\tif (current === child) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* default to working directory if no package.json is found */\n\treturn intial;\n}\n\n/**\n * Try to determine root directory based on the location of the closest\n * `package.json`. Fallbacks on `process.cwd()` if no package.json was found.\n *\n * @internal\n */\n/* istanbul ignore next: cached version of determineRootDirImpl, no need to test */\nexport function determineRootDir(): string {\n\tif (cachedRootDir === null) {\n\t\tcachedRootDir = determineRootDirImpl(process.cwd(), fs);\n\t}\n\treturn cachedRootDir;\n}\n","import path from \"node:path\";\n\n/**\n * @internal\n */\nexport function expandRelativePath<T>(value: string | T, { cwd }: { cwd: string }): string | T {\n\tif (typeof value === \"string\" && value.startsWith(\".\")) {\n\t\treturn path.normalize(path.join(cwd, value));\n\t} else {\n\t\treturn value;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { legacyRequire } from \"../../../resolve\";\nimport { type Transformer } from \"../../../transform\";\nimport { requireUncached } from \"../../../utils\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\n\n/**\n * @internal\n */\nexport interface RequireError extends Error {\n\tcode: string;\n}\n\nfunction isRequireError(error: unknown): error is RequireError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @since 8.8.0\n */\nexport type CommonJSResolver = Required<Resolver>;\n\n/**\n * CommonJS resolver.\n *\n * @public\n * @deprecated Deprecated alias for [[CommonJSResolver]].\n * @since 8.0.0\n */\nexport type NodeJSResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 8.8.0\n */\nexport function cjsResolver(options: { rootDir?: string } = {}): CommonJSResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\tfunction internalRequire<T = unknown>(id: string, { cache }: ResolverOptions): T | null {\n\t\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\t\ttry {\n\t\t\t/* istanbul ignore else: the tests only runs the cached versions to get\n\t\t\t * unmodified access to `require`, the implementation of `requireUncached`\n\t\t\t * is assumed to be tested elsewhere */\n\t\t\tif (cache) {\n\t\t\t\treturn legacyRequire(moduleName) as T;\n\t\t\t} else {\n\t\t\t\treturn requireUncached(legacyRequire, moduleName) as T;\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tif (isRequireError(err) && err.code === \"MODULE_NOT_FOUND\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"nodejs-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): MetaDataTable | null {\n\t\t\treturn internalRequire(id, options);\n\t\t},\n\n\t\tresolveConfig(id: string, options: ResolverOptions): ConfigData | null {\n\t\t\tconst configData = internalRequire<ConfigData>(id, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Plugin | null {\n\t\t\treturn internalRequire<Plugin>(id, options);\n\t\t},\n\n\t\tresolveTransformer(id: string, options: ResolverOptions): Transformer | null {\n\t\t\tconst mod = internalRequire<Transformer | Plugin>(id, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n\n/**\n * Create a new resolver for NodeJS packages using `require(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @deprecated Deprecated alias for [[commonjsResolver]].\n * @since 8.0.0\n */\n/* istanbul ignore next -- deprecated alias */\nexport function nodejsResolver(options: { rootDir?: string } = {}): NodeJSResolver {\n\treturn cjsResolver(options);\n}\n","/* istanbul ignore file: this file is only for easier mocking */\n\n/**\n * Wrapper around import() so we can mock it in unittests.\n *\n * @internal\n */\nexport function importFunction(id: string): unknown {\n\treturn import(id);\n}\n","import fs from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport { importResolve } from \"../../../resolve\";\nimport { UserError } from \"../../../error\";\nimport { type ResolverOptions } from \"../resolver\";\nimport { importFunction } from \"./import-function\";\n\n/**\n * @internal\n */\nexport interface ImportError extends Error {\n\tcode: string;\n\trequireStack?: string[];\n}\n\nasync function getModuleName(\n\tid: string,\n\t{ cache, rootDir }: { cache: boolean; rootDir: string },\n): Promise<URL> {\n\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\tconst url = importResolve(moduleName);\n\n\tif (url.protocol !== \"file:\") {\n\t\treturn url;\n\t}\n\n\t/* istanbul ignore else: the tests only runs the cached versions */\n\tif (cache) {\n\t\treturn url;\n\t} else {\n\t\t/* Cachebusting in ESM is tricky, we cannot flush the cache of the old import\n\t\t * but a common workaround is to append ?something to the path. It only works\n\t\t * with absolute paths though so we must first use `import.meta.resolve(..)`\n\t\t * which doesn't play nice with CJS. Then we will leak memory each time a\n\t\t * fresh copy is loaded and there doesn't seem to be a way to deal with this\n\t\t * yet. We use the file mtime to at least try to retain the copy as long as\n\t\t * possible but this will fail for transitive imports but at least with\n\t\t * directly loaded configurations it would reload property. */\n\t\tconst stat = await fs.stat(url);\n\t\turl.searchParams.append(\"mtime\", String(stat.mtime.getTime()));\n\t\treturn url;\n\t}\n}\n\nfunction isImportError(error: unknown): error is ImportError {\n\treturn Boolean(error && typeof error === \"object\" && \"code\" in error);\n}\n\n/**\n * @internal\n */\nexport async function internalImport<T = unknown>(\n\tid: string,\n\trootDir: string,\n\t{ cache }: ResolverOptions,\n): Promise<T | null> {\n\t/* this is a workaround for rollup which mangles import attributes so we\n\t * cannot use `import(.., { with: { type: \"json\" } })` to import a json\n\t * file. */\n\t/* istanbul ignore if: workaround, not tested, should be removed if the compiler bug is fixed */\n\tif (id.endsWith(\".json\")) {\n\t\tconst content = await fs.readFile(id, \"utf-8\");\n\t\treturn JSON.parse(content) as T;\n\t}\n\n\ttry {\n\t\tconst url = await getModuleName(id, { cache, rootDir });\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst moduleName = fileURLToPath(url);\n\n\t\tconst { default: defaultImport } = (await importFunction(moduleName)) as { default: T };\n\t\tif (!defaultImport) {\n\t\t\tthrow new UserError(`\"${id}\" does not have a default export`);\n\t\t}\n\t\treturn defaultImport;\n\t} catch (err: unknown) {\n\t\tif (isImportError(err) && err.code === \"MODULE_NOT_FOUND\" && !err.requireStack) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow err;\n\t}\n}\n","import path from \"node:path\";\nimport { type MetaDataTable } from \"../../../meta\";\nimport { type Plugin } from \"../../../plugin\";\nimport { type Transformer } from \"../../../transform\";\nimport { type ConfigData } from \"../../config-data\";\nimport { ConfigError } from \"../../error\";\nimport { type Resolver, type ResolverOptions } from \"../resolver\";\nimport { determineRootDir } from \"./determine-root-dir\";\nimport { expandRelativePath } from \"./expand-relative-path\";\nimport { internalImport } from \"./internal-import\";\n\nfunction isTransformer(value: Transformer | Plugin): value is Transformer {\n\treturn typeof value === \"function\";\n}\n\n/**\n * ESM resolver.\n *\n * @public\n * @since 9.0.0\n */\nexport type ESMResolver = Required<Resolver>;\n\n/**\n * Create a new resolver for NodeJS packages using `import(..)`.\n *\n * If the module name contains `<rootDir>` (e.g. `<rootDir/foo`) it will be\n * expanded relative to the root directory either explicitly set by the\n * `rootDir` parameter or determined automatically by the closest `package.json`\n * file (starting at the current working directory).\n *\n * @public\n * @since 9.0.0\n */\nexport function esmResolver(options: { rootDir?: string } = {}): ESMResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\treturn {\n\t\tname: \"esm-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): Promise<MetaDataTable | null> {\n\t\t\treturn internalImport(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveConfig(id: string, options: ResolverOptions): Promise<ConfigData | null> {\n\t\t\tconst configData = await internalImport<ConfigData>(id, rootDir, options);\n\t\t\tif (!configData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* expand any relative paths */\n\t\t\tconst cwd = path.dirname(id);\n\t\t\tconst expand = <T>(value: string | T): string | T => expandRelativePath(value, { cwd });\n\n\t\t\tif (Array.isArray(configData.elements)) {\n\t\t\t\tconfigData.elements = configData.elements.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.extends)) {\n\t\t\t\tconfigData.extends = configData.extends.map(expand);\n\t\t\t}\n\n\t\t\tif (Array.isArray(configData.plugins)) {\n\t\t\t\tconfigData.plugins = configData.plugins.map(expand);\n\t\t\t}\n\n\t\t\treturn configData;\n\t\t},\n\n\t\tresolvePlugin(id: string, options: ResolverOptions): Promise<Plugin | null> {\n\t\t\treturn internalImport<Plugin>(id, rootDir, options);\n\t\t},\n\n\t\tasync resolveTransformer(id: string, options: ResolverOptions): Promise<Transformer | null> {\n\t\t\tconst mod = await internalImport<Transformer | Plugin>(id, rootDir, options);\n\t\t\tif (!mod) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isTransformer(mod)) {\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t/* this is not a proper transformer, is it a plugin exposing a transformer? */\n\t\t\tif (mod.transformer) {\n\t\t\t\tthrow new ConfigError(\n\t\t\t\t\t`Module \"${id}\" is not a valid transformer. This looks like a plugin, did you forget to load the plugin first?`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new ConfigError(`Module \"${id}\" is not a valid transformer.`);\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Config } from \"../config\";\nimport { type ConfigData } from \"../config-data\";\nimport { ConfigLoader } from \"../config-loader\";\nimport { type ResolvedConfig } from \"../resolved-config\";\nimport { type Resolver } from \"../resolver\";\nimport { type FSLike, esmResolver } from \"../resolver/nodejs\";\nimport { isThenable } from \"../../utils\";\n\n/**\n * Options for [[FileSystemConfigLoader]].\n *\n * @public\n */\nexport interface FileSystemConfigLoaderOptions {\n\t/** An implementation of `fs` as needed by [[FileSystemConfigLoader]] */\n\tfs: FSLike;\n}\n\n/**\n * @internal\n */\nfunction findConfigurationFiles(fs: FSLike, directory: string): string[] {\n\treturn [\"json\", \"mjs\", \"cjs\", \"js\"]\n\t\t.map((extension) => path.join(directory, `.htmlvalidate.${extension}`))\n\t\t.filter((filePath) => fs.existsSync(filePath));\n}\n\nconst defaultResolvers: Resolver[] = [esmResolver()];\n\ntype ConstructorParametersDefault = [ConfigData?, Partial<FileSystemConfigLoaderOptions>?];\ntype ConstructorParametersResolver = [\n\tResolver[],\n\tConfigData?,\n\tPartial<FileSystemConfigLoaderOptions>?,\n];\ntype ConstructorParameters = ConstructorParametersDefault | ConstructorParametersResolver;\n\nfunction hasResolver(value: ConstructorParameters): value is ConstructorParametersResolver {\n\treturn Array.isArray(value[0]);\n}\n\n/**\n * Loads configuration by traversing filesystem.\n *\n * Configuration is read from three sources and in the following order:\n *\n * 1. Global configuration passed to constructor.\n * 2. Configuration files found when traversing the directory structure.\n * 3. Override passed to this function.\n *\n * The following configuration filenames are searched:\n *\n * - `.htmlvalidate.json`\n * - `.htmlvalidate.js`\n * - `.htmlvalidate.cjs`\n * - `.htmlvalidate.mjs`\n *\n * Global configuration is used when no configuration file is found. The\n * result is always merged with override if present.\n *\n * The `root` property set to `true` affects the configuration as following:\n *\n * 1. If set in override the override is returned as-is.\n * 2. If set in the global config the override is merged into global and\n * returned. No configuration files are searched.\n * 3. Setting `root` in configuration file only stops directory traversal.\n *\n * @public\n */\nexport class FileSystemConfigLoader extends ConfigLoader {\n\tprotected cache: Map<string, Config | null>;\n\tprivate fs: FSLike;\n\n\t/**\n\t * Create a filesystem configuration loader with default resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(config?: ConfigData, options?: Partial<FileSystemConfigLoaderOptions>);\n\n\t/**\n\t * Create a filesystem configuration loader with custom resolvers.\n\t *\n\t * @param fs - `fs` implementation,\n\t * @param resolvers - Resolvers to use.\n\t * @param config - Global configuration.\n\t * @param configFactory - Optional configuration factory.\n\t */\n\tpublic constructor(\n\t\tresolvers: Resolver[],\n\t\tconfig?: ConfigData,\n\t\toptions?: Partial<FileSystemConfigLoaderOptions>,\n\t);\n\n\tpublic constructor(...args: ConstructorParameters) {\n\t\tif (hasResolver(args)) {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [resolvers, config, options = {}] = args;\n\t\t\tsuper(resolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t} else {\n\t\t\t/* istanbul ignore next */\n\t\t\tconst [config, options = {}] = args;\n\t\t\tsuper(defaultResolvers, config);\n\t\t\tthis.fs = /* istanbul ignore next */ options.fs ?? fs;\n\t\t}\n\t\tthis.cache = new Map();\n\t}\n\n\t/**\n\t * Get configuration for given filename.\n\t *\n\t * @param filename - Filename to get configuration for.\n\t * @param configOverride - Configuration to merge final result with.\n\t */\n\tpublic override getConfigFor(\n\t\tfilename: string,\n\t\tconfigOverride?: ConfigData,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst override = this.loadFromObject(configOverride ?? {});\n\t\tif (isThenable(override)) {\n\t\t\treturn override.then((override) => {\n\t\t\t\treturn this._resolveAsync(filename, override);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync1(filename, override);\n\t\t}\n\t}\n\n\t/**\n\t * Flush configuration cache.\n\t *\n\t * @param filename - If given only the cache for that file is flushed.\n\t */\n\tpublic override flushCache(filename?: string): void {\n\t\tif (filename) {\n\t\t\tthis.cache.delete(filename);\n\t\t} else {\n\t\t\tthis.cache.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Load raw configuration from directory traversal.\n\t *\n\t * This configuration is not merged with global configuration and may return\n\t * `null` if no configuration files are found.\n\t */\n\tpublic fromFilename(filename: string): Config | Promise<Config | null> | null {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = this.loadFromFile(configFile);\n\n\t\t\t\t/* if the loader returns an async config we exit out of the synchronous\n\t\t\t\t * processing and enter the async method so we can resolve any promises\n\t\t\t\t * as we go */\n\t\t\t\tif (isThenable(local)) {\n\t\t\t\t\treturn this.fromFilenameAsync(filename);\n\t\t\t\t}\n\n\t\t\t\tfound = true;\n\n\t\t\t\tconst merged = local.merge(this.resolvers, config);\n\n\t\t\t\t/* istanbul ignore if -- should never happen */\n\t\t\t\tif (isThenable(merged)) {\n\t\t\t\t\tthrow new Error(\"internal error: async result ended up in sync path\");\n\t\t\t\t}\n\t\t\t\tconfig = merged;\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\t/**\n\t * Async version of [[fromFilename]].\n\t *\n\t * @internal\n\t */\n\tpublic async fromFilenameAsync(filename: string): Promise<Config | null> {\n\t\tif (filename === \"inline\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst cache = this.cache.get(filename);\n\t\tif (cache) {\n\t\t\treturn cache;\n\t\t}\n\n\t\tlet found = false;\n\t\tlet current = path.resolve(path.dirname(filename));\n\t\tlet config = this.empty();\n\n\t\t// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition -- it will break out when filesystem is traversed\n\t\twhile (true) {\n\t\t\t/* search configuration files in current directory */\n\t\t\tfor (const configFile of findConfigurationFiles(this.fs, current)) {\n\t\t\t\tconst local = await this.loadFromFile(configFile);\n\t\t\t\tfound = true;\n\t\t\t\tconfig = await local.merge(this.resolvers, config);\n\t\t\t}\n\n\t\t\t/* stop if a configuration with \"root\" is set to true */\n\t\t\tif (config.isRootFound()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get the parent directory */\n\t\t\tconst child = current;\n\t\t\tcurrent = path.dirname(current);\n\n\t\t\t/* stop if this is the root directory */\n\t\t\tif (current === child) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* no config was found by loader, return null and let caller decide what to do */\n\t\tif (!found) {\n\t\t\tthis.cache.set(filename, null);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.cache.set(filename, config);\n\t\treturn config;\n\t}\n\n\tprivate _merge(\n\t\tglobalConfig: Config,\n\t\toverride: Config,\n\t\tconfig: Config | null,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tconst merged = config\n\t\t\t? config.merge(this.resolvers, override)\n\t\t\t: globalConfig.merge(this.resolvers, override);\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(merged)) {\n\t\t\treturn merged.then((merged) => {\n\t\t\t\treturn merged.resolve();\n\t\t\t});\n\t\t} else {\n\t\t\treturn merged.resolve();\n\t\t}\n\t}\n\n\tprivate _resolveSync1(\n\t\tfilename: string,\n\t\toverride: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = this.getGlobalConfig();\n\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\tif (isThenable(globalConfig)) {\n\t\t\treturn globalConfig.then((globalConfig) => {\n\t\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._resolveSync2(filename, override, globalConfig);\n\t\t}\n\t}\n\n\tprivate _resolveSync2(\n\t\tfilename: string,\n\t\toverride: Config,\n\t\tglobalConfig: Config,\n\t): ResolvedConfig | Promise<ResolvedConfig> {\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = globalConfig.merge(this.resolvers, override);\n\t\t\t/* istanbul ignore if -- covered by tsc, hard to recreate even with very specific testcases */\n\t\t\tif (isThenable(merged)) {\n\t\t\t\treturn merged.then((merged) => {\n\t\t\t\t\treturn merged.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn merged.resolve();\n\t\t\t}\n\t\t}\n\n\t\tconst config = this.fromFilename(filename);\n\t\tif (isThenable(config)) {\n\t\t\treturn config.then((config) => {\n\t\t\t\treturn this._merge(globalConfig, override, config);\n\t\t\t});\n\t\t} else {\n\t\t\treturn this._merge(globalConfig, override, config);\n\t\t}\n\t}\n\n\tprivate async _resolveAsync(filename: string, override: Config): Promise<ResolvedConfig> {\n\t\tif (override.isRootFound()) {\n\t\t\treturn override.resolve();\n\t\t}\n\n\t\tconst globalConfig = await this.getGlobalConfig();\n\n\t\t/* special case when the global configuration is marked as root, should not\n\t\t * try to load and more configuration files */\n\t\tif (globalConfig.isRootFound()) {\n\t\t\tconst merged = await globalConfig.merge(this.resolvers, override);\n\t\t\treturn merged.resolve();\n\t\t}\n\n\t\tconst config = await this.fromFilenameAsync(filename);\n\t\treturn this._merge(globalConfig, override, config);\n\t}\n\n\t/**\n\t * @internal For testing only\n\t */\n\tpublic _getInternalCache(): Map<string, Config | null> {\n\t\treturn this.cache;\n\t}\n\n\tprotected defaultConfig(): Config | Promise<Config> {\n\t\treturn Config.defaultConfig();\n\t}\n}\n","import kleur from \"kleur\";\nimport { version } from \"../generated/package\";\nimport { type CompatibilityOptions, compatibilityCheckImpl } from \"./compatibility-check\";\n\nconst defaults: CompatibilityOptions = {\n\tsilent: false,\n\tversion,\n\tlogger(text: string): void {\n\t\t/* eslint-disable-next-line no-console -- expected to log */\n\t\tconsole.error(kleur.red(text));\n\t},\n};\n\n/**\n * Tests if plugin is compatible with html-validate library. Unless the `silent`\n * option is used a warning is displayed on the console.\n *\n * @public\n * @since v5.0.0\n * @param name - Name of plugin\n * @param declared - What library versions the plugin support (e.g. declared peerDependencies)\n * @returns - `true` if version is compatible\n */\nexport function compatibilityCheck(\n\tname: string,\n\tdeclared: string,\n\toptions?: Partial<CompatibilityOptions>,\n): boolean {\n\treturn compatibilityCheckImpl(name, declared, {\n\t\t...defaults,\n\t\t...options,\n\t});\n}\n"],"names":["fs","isTransformer","options","override","merged","globalConfig","config"],"mappings":";;;;;;;;AAGgB,SAAA,eAAA,CAAgB,SAAyB,QAA2B,EAAA;AACnF,EAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAGzC,EAAM,MAAA,CAAA,GAAI,OAAQ,CAAA,KAAA,CAAM,QAAQ,CAAA;AAChC,EAAA,IAAI,GAAG,MAAQ,EAAA;AACd,IAAM,MAAA,EAAE,QAAW,GAAA,CAAA;AACnB,IAAA,KAAA,IAAS,IAAI,MAAO,CAAA,QAAA,CAAS,SAAS,CAAG,EAAA,CAAA,IAAK,GAAG,CAAK,EAAA,EAAA;AACrD,MAAA,IAAI,MAAO,CAAA,QAAA,CAAS,CAAC,CAAA,CAAE,OAAO,QAAU,EAAA;AACvC,QAAO,MAAA,CAAA,QAAA,CAAS,MAAO,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA;AAC5B;AACD;AAKD,EAAO,OAAA,OAAA,CAAQ,MAAM,QAAQ,CAAA;AAG7B,EAAA,OAAO,QAAQ,QAAQ,CAAA;AACxB;;;;;;;ACpBA,IAAI,aAA+B,GAAA,IAAA;AASnB,SAAA,oBAAA,CAAqB,QAAgBA,GAAoB,EAAA;AAExE,EAAA,IAAI,OAAU,GAAA,MAAA;AAGd,EAAA,OAAO,IAAM,EAAA;AACZ,IAAA,MAAM,MAAS,GAAA,IAAA,CAA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