html-validate 9.0.0-rc.3 → 9.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/html-validate.mjs +3 -0
- package/dist/cjs/browser.js +1 -0
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/core-nodejs.js +69 -40
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +167 -46
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/html-validate.js +1 -0
- package/dist/cjs/html-validate.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jest.js +2 -1
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/matchers.js +1 -1
- package/dist/cjs/matchers.js.map +1 -1
- package/dist/cjs/vitest.js +2 -1
- package/dist/cjs/vitest.js.map +1 -1
- package/dist/es/browser.js +1 -1
- package/dist/es/core-nodejs.js +66 -39
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +167 -47
- package/dist/es/core.js.map +1 -1
- package/dist/es/html-validate.js +2 -1
- package/dist/es/html-validate.js.map +1 -1
- package/dist/es/index.js +2 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/jest.js +2 -1
- package/dist/es/jest.js.map +1 -1
- package/dist/es/matchers.js +2 -2
- package/dist/es/matchers.js.map +1 -1
- package/dist/es/vitest.js +2 -1
- package/dist/es/vitest.js.map +1 -1
- package/dist/types/browser.d.ts +19 -2
- package/dist/types/index.d.ts +6 -5
- package/package.json +2 -2
- package/bin/html-validate.js +0 -4
package/dist/cjs/browser.js
CHANGED
|
@@ -49,6 +49,7 @@ exports.classifyNodeText = core.classifyNodeText;
|
|
|
49
49
|
exports.configPresets = core.presets;
|
|
50
50
|
exports.defineConfig = core.defineConfig;
|
|
51
51
|
exports.definePlugin = core.definePlugin;
|
|
52
|
+
exports.esmResolver = core.esmResolver;
|
|
52
53
|
exports.keywordPatternMatcher = core.keywordPatternMatcher;
|
|
53
54
|
exports.ruleExists = core.ruleExists;
|
|
54
55
|
exports.sliceLocation = core.sliceLocation;
|
package/dist/cjs/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/core-nodejs.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var fs$1 = require('node:fs/promises');
|
|
4
3
|
var path = require('node:path');
|
|
5
4
|
var core = require('./core.js');
|
|
6
5
|
var fs = require('node:fs');
|
|
6
|
+
var fs$1 = require('node:fs/promises');
|
|
7
|
+
var node_url = require('node:url');
|
|
7
8
|
var kleur = require('kleur');
|
|
8
9
|
|
|
9
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
|
|
11
|
-
var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
|
|
12
12
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
13
13
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
14
|
+
var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
|
|
14
15
|
var kleur__default = /*#__PURE__*/_interopDefault(kleur);
|
|
15
16
|
|
|
16
17
|
function requireUncached(require, moduleId) {
|
|
@@ -29,6 +30,9 @@ function requireUncached(require, moduleId) {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const legacyRequire = require;
|
|
33
|
+
const importResolve = (specifier) => {
|
|
34
|
+
return node_url.pathToFileURL(require.resolve(specifier));
|
|
35
|
+
};
|
|
32
36
|
|
|
33
37
|
let cachedRootDir = null;
|
|
34
38
|
function determineRootDirImpl(intial, fs2) {
|
|
@@ -131,49 +135,58 @@ function nodejsResolver(options = {}) {
|
|
|
131
135
|
return cjsResolver(options);
|
|
132
136
|
}
|
|
133
137
|
|
|
138
|
+
async function getModuleName(id, { cache, rootDir }) {
|
|
139
|
+
const moduleName = id.replace("<rootDir>", rootDir);
|
|
140
|
+
const url = new URL(importResolve(moduleName));
|
|
141
|
+
if (url.protocol !== "file:") {
|
|
142
|
+
return url;
|
|
143
|
+
}
|
|
144
|
+
if (cache) {
|
|
145
|
+
return url;
|
|
146
|
+
}
|
|
147
|
+
const stat = await fs__default$1.default.stat(url);
|
|
148
|
+
url.searchParams.append("mtime", String(stat.mtime.getTime()));
|
|
149
|
+
return url;
|
|
150
|
+
}
|
|
134
151
|
function isRequireError(error) {
|
|
135
152
|
return Boolean(error && typeof error === "object" && "code" in error);
|
|
136
153
|
}
|
|
154
|
+
async function internalImport(id, rootDir, { cache }) {
|
|
155
|
+
if (id.endsWith(".json")) {
|
|
156
|
+
const content = await fs__default$1.default.readFile(id, "utf-8");
|
|
157
|
+
return JSON.parse(content);
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
const url = await getModuleName(id, { cache, rootDir });
|
|
161
|
+
if (url.protocol !== "file:") {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const moduleName = node_url.fileURLToPath(url);
|
|
165
|
+
const { default: defaultImport } = await import(moduleName);
|
|
166
|
+
if (!defaultImport) {
|
|
167
|
+
throw new core.UserError(`"${id}" does not have a default export`);
|
|
168
|
+
}
|
|
169
|
+
return defaultImport;
|
|
170
|
+
} catch (err) {
|
|
171
|
+
if (isRequireError(err) && err.code === "MODULE_NOT_FOUND" && !err.requireStack) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
throw err;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
137
178
|
function isTransformer(value) {
|
|
138
179
|
return typeof value === "function";
|
|
139
180
|
}
|
|
140
|
-
let cachebuster = 1;
|
|
141
|
-
function getModuleName(id, { cache, rootDir }) {
|
|
142
|
-
const moduleName = id.replace("<rootDir>", rootDir);
|
|
143
|
-
if (cache) {
|
|
144
|
-
return `${moduleName}?cachebuster=${String(cachebuster++)}`;
|
|
145
|
-
} else {
|
|
146
|
-
return moduleName;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
181
|
function esmResolver(options = {}) {
|
|
150
182
|
const rootDir = options.rootDir ?? determineRootDir();
|
|
151
|
-
async function internalImport(id, { cache }) {
|
|
152
|
-
if (id.endsWith(".json")) {
|
|
153
|
-
const content = await fs__default$1.default.readFile(id, "utf-8");
|
|
154
|
-
return JSON.parse(content);
|
|
155
|
-
}
|
|
156
|
-
const moduleName = getModuleName(id, { cache, rootDir });
|
|
157
|
-
try {
|
|
158
|
-
const { default: defaultImport } = await import(moduleName);
|
|
159
|
-
if (!defaultImport) {
|
|
160
|
-
throw new core.UserError(`"${id}" does not have a default export`);
|
|
161
|
-
}
|
|
162
|
-
return defaultImport;
|
|
163
|
-
} catch (err) {
|
|
164
|
-
if (isRequireError(err) && err.code === "MODULE_NOT_FOUND") {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
throw err;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
183
|
return {
|
|
171
184
|
name: "esm-resolver",
|
|
172
185
|
resolveElements(id, options2) {
|
|
173
|
-
return internalImport(id, options2);
|
|
186
|
+
return internalImport(id, rootDir, options2);
|
|
174
187
|
},
|
|
175
188
|
async resolveConfig(id, options2) {
|
|
176
|
-
const configData = await internalImport(id, options2);
|
|
189
|
+
const configData = await internalImport(id, rootDir, options2);
|
|
177
190
|
if (!configData) {
|
|
178
191
|
return null;
|
|
179
192
|
}
|
|
@@ -191,10 +204,10 @@ function esmResolver(options = {}) {
|
|
|
191
204
|
return configData;
|
|
192
205
|
},
|
|
193
206
|
resolvePlugin(id, options2) {
|
|
194
|
-
return internalImport(id, options2);
|
|
207
|
+
return internalImport(id, rootDir, options2);
|
|
195
208
|
},
|
|
196
209
|
async resolveTransformer(id, options2) {
|
|
197
|
-
const mod = await internalImport(id, options2);
|
|
210
|
+
const mod = await internalImport(id, rootDir, options2);
|
|
198
211
|
if (!mod) {
|
|
199
212
|
return null;
|
|
200
213
|
}
|
|
@@ -214,7 +227,7 @@ function esmResolver(options = {}) {
|
|
|
214
227
|
function findConfigurationFiles(fs2, directory) {
|
|
215
228
|
return ["json", "mjs", "cjs", "js"].map((extension) => path__default.default.join(directory, `.htmlvalidate.${extension}`)).filter((filePath) => fs2.existsSync(filePath));
|
|
216
229
|
}
|
|
217
|
-
const defaultResolvers = [
|
|
230
|
+
const defaultResolvers = [esmResolver()];
|
|
218
231
|
function hasResolver(value) {
|
|
219
232
|
return Array.isArray(value[0]);
|
|
220
233
|
}
|
|
@@ -287,7 +300,11 @@ class FileSystemConfigLoader extends core.ConfigLoader {
|
|
|
287
300
|
return this.fromFilenameAsync(filename);
|
|
288
301
|
}
|
|
289
302
|
found = true;
|
|
290
|
-
|
|
303
|
+
const merged = local.merge(this.resolvers, config);
|
|
304
|
+
if (core.isThenable(merged)) {
|
|
305
|
+
throw new Error("internal error: async result ended up in sync path");
|
|
306
|
+
}
|
|
307
|
+
config = merged;
|
|
291
308
|
}
|
|
292
309
|
if (config.isRootFound()) {
|
|
293
310
|
break;
|
|
@@ -325,7 +342,7 @@ class FileSystemConfigLoader extends core.ConfigLoader {
|
|
|
325
342
|
for (const configFile of findConfigurationFiles(this.fs, current)) {
|
|
326
343
|
const local = await this.loadFromFile(configFile);
|
|
327
344
|
found = true;
|
|
328
|
-
config = local.merge(this.resolvers, config);
|
|
345
|
+
config = await local.merge(this.resolvers, config);
|
|
329
346
|
}
|
|
330
347
|
if (config.isRootFound()) {
|
|
331
348
|
break;
|
|
@@ -345,7 +362,13 @@ class FileSystemConfigLoader extends core.ConfigLoader {
|
|
|
345
362
|
}
|
|
346
363
|
_merge(globalConfig, override, config) {
|
|
347
364
|
const merged = config ? config.merge(this.resolvers, override) : globalConfig.merge(this.resolvers, override);
|
|
348
|
-
|
|
365
|
+
if (core.isThenable(merged)) {
|
|
366
|
+
return merged.then((merged2) => {
|
|
367
|
+
return merged2.resolve();
|
|
368
|
+
});
|
|
369
|
+
} else {
|
|
370
|
+
return merged.resolve();
|
|
371
|
+
}
|
|
349
372
|
}
|
|
350
373
|
_resolveSync1(filename, override) {
|
|
351
374
|
if (override.isRootFound()) {
|
|
@@ -363,7 +386,13 @@ class FileSystemConfigLoader extends core.ConfigLoader {
|
|
|
363
386
|
_resolveSync2(filename, override, globalConfig) {
|
|
364
387
|
if (globalConfig.isRootFound()) {
|
|
365
388
|
const merged = globalConfig.merge(this.resolvers, override);
|
|
366
|
-
|
|
389
|
+
if (core.isThenable(merged)) {
|
|
390
|
+
return merged.then((merged2) => {
|
|
391
|
+
return merged2.resolve();
|
|
392
|
+
});
|
|
393
|
+
} else {
|
|
394
|
+
return merged.resolve();
|
|
395
|
+
}
|
|
367
396
|
}
|
|
368
397
|
const config = this.fromFilename(filename);
|
|
369
398
|
if (core.isThenable(config)) {
|
|
@@ -380,7 +409,7 @@ class FileSystemConfigLoader extends core.ConfigLoader {
|
|
|
380
409
|
}
|
|
381
410
|
const globalConfig = await this.getGlobalConfig();
|
|
382
411
|
if (globalConfig.isRootFound()) {
|
|
383
|
-
const merged = globalConfig.merge(this.resolvers, override);
|
|
412
|
+
const merged = await globalConfig.merge(this.resolvers, override);
|
|
384
413
|
return merged.resolve();
|
|
385
414
|
}
|
|
386
415
|
const config = await this.fromFilenameAsync(filename);
|
|
@@ -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/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 path from \"node:path\";\nimport { UserError } from \"../../../error\";\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\";\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 * ESM resolver.\n *\n * @public\n * @since %version%\n */\nexport type ESMResolver = Required<Resolver>;\n\nlet cachebuster = 1;\n\nfunction getModuleName(\n\tid: string,\n\t{ cache, rootDir }: { cache: boolean; rootDir: string },\n): string {\n\tconst moduleName = id.replace(\"<rootDir>\", rootDir);\n\n\t/* istanbul ignore next: the tests only runs the cached versions to get\n\t * unmodified access to `require`, the implementation of `requireUncached`\n\t * is assumed to be tested elsewhere */\n\tif (cache) {\n\t\treturn `${moduleName}?cachebuster=${String(cachebuster++)}`;\n\t} else {\n\t\treturn moduleName;\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 * @since %version%\n */\nexport function esmResolver(options: { rootDir?: string } = {}): ESMResolver {\n\tconst rootDir = options.rootDir ?? determineRootDir();\n\n\tasync function internalImport<T = unknown>(\n\t\tid: string,\n\t\t{ cache }: ResolverOptions,\n\t): Promise<T | null> {\n\t\t/* this is a workaround for rollup which mangles import attributes so we\n\t\t * cannot use `import(.., { with: { type: \"json\" } })` to import a json\n\t\t * file. */\n\t\tif (id.endsWith(\".json\")) {\n\t\t\tconst content = await fs.readFile(id, \"utf-8\");\n\t\t\treturn JSON.parse(content) as T;\n\t\t}\n\n\t\tconst moduleName = getModuleName(id, { cache, rootDir });\n\n\t\ttry {\n\t\t\tconst { default: defaultImport } = (await import(moduleName)) as { default: T };\n\t\t\tif (!defaultImport) {\n\t\t\t\tthrow new UserError(`\"${id}\" does not have a default export`);\n\t\t\t}\n\t\t\treturn defaultImport;\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: \"esm-resolver\",\n\n\t\tresolveElements(id: string, options: ResolverOptions): Promise<MetaDataTable | null> {\n\t\t\treturn internalImport(id, 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, 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, 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, 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, cjsResolver } 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[] = [cjsResolver()];\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\t\t\t\tconfig = 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\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 = 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\treturn merged.resolve();\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\treturn merged.resolve();\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 = 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","path","isRequireError","isTransformer","options","ConfigError","User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IAAK,CAAA,MAAA,CAAO,YAAc,EAAA,QAAA,EAAU,MAAM,CAAA;AAAA;AAClD;AAAA;AAAA;AAAA,EAKO,iBAAgD,GAAA;AACtD,IAAA,OAAO,IAAK,CAAA,KAAA;AAAA;AACb,EAEU,aAA0C,GAAA;AACnD,IAAA,OAAOC,YAAO,aAAc,EAAA;AAAA;AAE9B;;AChVA,MAAM,QAAiC,GAAA;AAAA,EACtC,MAAQ,EAAA,KAAA;AAAA,WACRC,YAAA;AAAA,EACA,OAAO,IAAoB,EAAA;AAE1B,IAAA,OAAA,CAAQ,KAAM,CAAAC,sBAAA,CAAM,GAAI,CAAA,IAAI,CAAC,CAAA;AAAA;AAE/B,CAAA;AAYgB,SAAA,kBAAA,CACf,IACA,EAAA,QAAA,EACA,OACU,EAAA;AACV,EAAO,OAAAC,2BAAA,CAAuB,MAAM,QAAU,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/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","path","isRequireError","isTransformer","options","ConfigError","fileURLToPath","UserError","ConfigLoader","isThenable","override","merged","globalConfig","config","Config","version","kleur","compatibilityCheckImpl"],"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;;;;;;;ACpB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