From dd06f878afff25b3439e2f0e5ee00dd20521ce1e Mon Sep 17 00:00:00 2001 From: Ken Hawkins Date: Mon, 8 Jan 2024 10:17:03 +0100 Subject: [PATCH 1/3] Allow passing of a custom header for all requests Will partly resolve https://github.com/stevenvachon/broken-link-checker/issues/212 For our use case this prevents the site from tipping DDOS prevention. --- README.md | 4 ++++ lib/internal/http-protocol/request.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb5f9693..8b12745a 100644 --- a/README.md +++ b/README.md @@ -380,6 +380,10 @@ Type: `String` Default value: `'broken-link-checker/0.8.0 Node.js/14.16.0 (OS X; x64)'` (or similar) The HTTP user-agent to use when checking links as well as retrieving pages and robot exclusions. +### `customHeaders` +Type: `object` +Default value: `{}` +Pass any headers as a global setting such as `{ my-header-dev-tester": "MY_KEY_HERE" }` ## Handling Broken/Excluded Links A broken link will have an `isBroken` value of `true` and a reason code defined in `brokenReason`. A link that was not checked (emitted as `'junk'`) will have a `wasExcluded` value of `true`, a reason code defined in `excludedReason` and a `isBroken` value of `null`. diff --git a/lib/internal/http-protocol/request.js b/lib/internal/http-protocol/request.js index d8ffeb31..12a7cd32 100644 --- a/lib/internal/http-protocol/request.js +++ b/lib/internal/http-protocol/request.js @@ -27,7 +27,7 @@ const createRequest = (url, auth, method, options, isRetry=false) => new Promise streamHTTP(url, { auth: stringifyAuth(url, auth), - headers: { "user-agent":options.userAgent }, + headers: { "user-agent":options.userAgent, ...options.customHeaders }, method, rejectUnauthorized: false, // accept self-signed SSL certificates retry: 0, From ef73203a13323342dd0b3417b5fbcf926b624a7b Mon Sep 17 00:00:00 2001 From: Ken Hawkins Date: Mon, 8 Jan 2024 10:26:05 +0100 Subject: [PATCH 2/3] Commit lib-cjs to use in projects. --- .gitignore | 1 - lib-cjs/cli.js | 481 ++++++++++++++++++ lib-cjs/cli.js.map | 1 + lib-cjs/index.js | 67 +++ lib-cjs/index.js.map | 1 + lib-cjs/internal/Link.js | 232 +++++++++ lib-cjs/internal/Link.js.map | 1 + lib-cjs/internal/SafeEventEmitter.js | 25 + lib-cjs/internal/SafeEventEmitter.js.map | 1 + lib-cjs/internal/checkLink.js | 69 +++ lib-cjs/internal/checkLink.js.map | 1 + lib-cjs/internal/defaultOptions.js | 37 ++ lib-cjs/internal/defaultOptions.js.map | 1 + lib-cjs/internal/errors.js | 31 ++ lib-cjs/internal/errors.js.map | 1 + lib-cjs/internal/events.js | 17 + lib-cjs/internal/events.js.map | 1 + lib-cjs/internal/file-protocol/checkLink.js | 35 ++ .../internal/file-protocol/checkLink.js.map | 1 + lib-cjs/internal/file-protocol/errors.js | 19 + lib-cjs/internal/file-protocol/errors.js.map | 1 + lib-cjs/internal/file-protocol/index.js | 35 ++ lib-cjs/internal/file-protocol/index.js.map | 1 + .../file-protocol/isCompatibleScheme.js | 15 + .../file-protocol/isCompatibleScheme.js.map | 1 + lib-cjs/internal/file-protocol/streamHTML.js | 37 ++ .../internal/file-protocol/streamHTML.js.map | 1 + lib-cjs/internal/http-protocol/checkLink.js | 84 +++ .../internal/http-protocol/checkLink.js.map | 1 + lib-cjs/internal/http-protocol/errors.js | 21 + lib-cjs/internal/http-protocol/errors.js.map | 1 + .../internal/http-protocol/getRobotsTxt.js | 41 ++ .../http-protocol/getRobotsTxt.js.map | 1 + lib-cjs/internal/http-protocol/index.js | 49 ++ lib-cjs/internal/http-protocol/index.js.map | 1 + .../http-protocol/isCompatibleScheme.js | 17 + .../http-protocol/isCompatibleScheme.js.map | 1 + lib-cjs/internal/http-protocol/request.js | 146 ++++++ lib-cjs/internal/http-protocol/request.js.map | 1 + lib-cjs/internal/http-protocol/streamHTML.js | 50 ++ .../internal/http-protocol/streamHTML.js.map | 1 + .../internal/http-protocol/transitiveAuth.js | 42 ++ .../http-protocol/transitiveAuth.js.map | 1 + lib-cjs/internal/matchURL.js | 25 + lib-cjs/internal/matchURL.js.map | 1 + lib-cjs/internal/parseHTML.js | 59 +++ lib-cjs/internal/parseHTML.js.map | 1 + lib-cjs/internal/parseOptions.js | 33 ++ lib-cjs/internal/parseOptions.js.map | 1 + lib-cjs/internal/reasons.js | 32 ++ lib-cjs/internal/reasons.js.map | 1 + lib-cjs/internal/scrapeHTML.js | 269 ++++++++++ lib-cjs/internal/scrapeHTML.js.map | 1 + lib-cjs/internal/streamHTML.js | 40 ++ lib-cjs/internal/streamHTML.js.map | 1 + lib-cjs/internal/tags.js | 221 ++++++++ lib-cjs/internal/tags.js.map | 1 + lib-cjs/public/HtmlChecker.js | 229 +++++++++ lib-cjs/public/HtmlChecker.js.map | 1 + lib-cjs/public/HtmlUrlChecker.js | 212 ++++++++ lib-cjs/public/HtmlUrlChecker.js.map | 1 + lib-cjs/public/SiteChecker.js | 319 ++++++++++++ lib-cjs/public/SiteChecker.js.map | 1 + lib-cjs/public/UrlChecker.js | 106 ++++ lib-cjs/public/UrlChecker.js.map | 1 + 65 files changed, 3127 insertions(+), 1 deletion(-) create mode 100644 lib-cjs/cli.js create mode 100644 lib-cjs/cli.js.map create mode 100644 lib-cjs/index.js create mode 100644 lib-cjs/index.js.map create mode 100644 lib-cjs/internal/Link.js create mode 100644 lib-cjs/internal/Link.js.map create mode 100644 lib-cjs/internal/SafeEventEmitter.js create mode 100644 lib-cjs/internal/SafeEventEmitter.js.map create mode 100644 lib-cjs/internal/checkLink.js create mode 100644 lib-cjs/internal/checkLink.js.map create mode 100644 lib-cjs/internal/defaultOptions.js create mode 100644 lib-cjs/internal/defaultOptions.js.map create mode 100644 lib-cjs/internal/errors.js create mode 100644 lib-cjs/internal/errors.js.map create mode 100644 lib-cjs/internal/events.js create mode 100644 lib-cjs/internal/events.js.map create mode 100644 lib-cjs/internal/file-protocol/checkLink.js create mode 100644 lib-cjs/internal/file-protocol/checkLink.js.map create mode 100644 lib-cjs/internal/file-protocol/errors.js create mode 100644 lib-cjs/internal/file-protocol/errors.js.map create mode 100644 lib-cjs/internal/file-protocol/index.js create mode 100644 lib-cjs/internal/file-protocol/index.js.map create mode 100644 lib-cjs/internal/file-protocol/isCompatibleScheme.js create mode 100644 lib-cjs/internal/file-protocol/isCompatibleScheme.js.map create mode 100644 lib-cjs/internal/file-protocol/streamHTML.js create mode 100644 lib-cjs/internal/file-protocol/streamHTML.js.map create mode 100644 lib-cjs/internal/http-protocol/checkLink.js create mode 100644 lib-cjs/internal/http-protocol/checkLink.js.map create mode 100644 lib-cjs/internal/http-protocol/errors.js create mode 100644 lib-cjs/internal/http-protocol/errors.js.map create mode 100644 lib-cjs/internal/http-protocol/getRobotsTxt.js create mode 100644 lib-cjs/internal/http-protocol/getRobotsTxt.js.map create mode 100644 lib-cjs/internal/http-protocol/index.js create mode 100644 lib-cjs/internal/http-protocol/index.js.map create mode 100644 lib-cjs/internal/http-protocol/isCompatibleScheme.js create mode 100644 lib-cjs/internal/http-protocol/isCompatibleScheme.js.map create mode 100644 lib-cjs/internal/http-protocol/request.js create mode 100644 lib-cjs/internal/http-protocol/request.js.map create mode 100644 lib-cjs/internal/http-protocol/streamHTML.js create mode 100644 lib-cjs/internal/http-protocol/streamHTML.js.map create mode 100644 lib-cjs/internal/http-protocol/transitiveAuth.js create mode 100644 lib-cjs/internal/http-protocol/transitiveAuth.js.map create mode 100644 lib-cjs/internal/matchURL.js create mode 100644 lib-cjs/internal/matchURL.js.map create mode 100644 lib-cjs/internal/parseHTML.js create mode 100644 lib-cjs/internal/parseHTML.js.map create mode 100644 lib-cjs/internal/parseOptions.js create mode 100644 lib-cjs/internal/parseOptions.js.map create mode 100644 lib-cjs/internal/reasons.js create mode 100644 lib-cjs/internal/reasons.js.map create mode 100644 lib-cjs/internal/scrapeHTML.js create mode 100644 lib-cjs/internal/scrapeHTML.js.map create mode 100644 lib-cjs/internal/streamHTML.js create mode 100644 lib-cjs/internal/streamHTML.js.map create mode 100644 lib-cjs/internal/tags.js create mode 100644 lib-cjs/internal/tags.js.map create mode 100644 lib-cjs/public/HtmlChecker.js create mode 100644 lib-cjs/public/HtmlChecker.js.map create mode 100644 lib-cjs/public/HtmlUrlChecker.js create mode 100644 lib-cjs/public/HtmlUrlChecker.js.map create mode 100644 lib-cjs/public/SiteChecker.js create mode 100644 lib-cjs/public/SiteChecker.js.map create mode 100644 lib-cjs/public/UrlChecker.js create mode 100644 lib-cjs/public/UrlChecker.js.map diff --git a/.gitignore b/.gitignore index 033f9d61..116220c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ coverage/ -lib-cjs/ node_modules/ package-lock.json diff --git a/lib-cjs/cli.js b/lib-cjs/cli.js new file mode 100644 index 00000000..d58b9414 --- /dev/null +++ b/lib-cjs/cli.js @@ -0,0 +1,481 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _Link = require("./internal/Link"); +var _defaultOptions = _interopRequireDefault(require("./internal/defaultOptions")); +var _events = require("./internal/events"); +var _gauge = _interopRequireDefault(require("gauge")); +var _httpMethodsConstants = require("http-methods-constants"); +var _chalk = require("chalk"); +var _ = require("./"); +var _humanizeDuration = _interopRequireDefault(require("humanize-duration")); +var _longest = _interopRequireDefault(require("longest")); +var _keyscan = require("keyscan"); +var _nodeNotifier = _interopRequireDefault(require("node-notifier")); +var _url = require("url"); +var _stripAnsi = _interopRequireDefault(require("strip-ansi")); +var _supportsSemigraphics = _interopRequireDefault(require("supports-semigraphics")); +var _themes = require("gauge/themes"); +var _package = require("../package.json"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* eslint-disable no-console */ + +const title = "Broken Link Checker"; +let checker, checkerOptions, gauge, keyScanner, logOptions, pauseMessage, spinner, stats, urls; +const argsToOptions = args => { + const renames = { + exclude: "excludedKeywords", + excludeExternal: "excludeExternalLinks", + excludeInternal: "excludeInternalLinks", + follow: "followRobotExclusions", + hostRequests: "maxSocketsPerHost", + include: "includedKeywords", + ordered: "maintainLinkOrder", + requests: "maxSockets" + }; + return Object.entries(args).reduce((opts, [argName, argValue]) => { + if (argName in renames) { + opts[renames[argName]] = argValue; + } else if (argName in _defaultOptions.default) { + opts[argName] = argValue; + } else if (args.get) { + opts.requestMethod = _httpMethodsConstants.GET; + } + return opts; + }, {}); +}; +const log = (...args) => { + // Avoid spinner/progress chars getting stuck in the log + gauge.hide(); + console.log(...args); + gauge.show(); +}; +const logPage = pageURL => { + log(`${(0, _chalk.white)("\nGetting links from:")} ${(0, _chalk.yellow)(pageURL)}`); +}; +const logPageMetrics = () => { + let output = (0, _chalk.gray)(`Finished! ${stats.page.totalLinks} links found.`); + if (stats.page.skippedLinks > 0) { + output += (0, _chalk.gray)(` ${stats.page.skippedLinks} skipped.`); + } + if (stats.page.totalLinks > 0) { + output += (0, _chalk.gray)(" "); + if (stats.page.brokenLinks > 0) { + output += (0, _chalk.red)(`${stats.page.brokenLinks} broken`); + } else { + output += (0, _chalk.green)(`${stats.page.brokenLinks} broken`); + } + output += (0, _chalk.gray)("."); + } + log(output); +}; +const logProgress = () => { + const links = checker.numActiveLinks + checker.numQueuedLinks; + const pageCompletion = links > 0 ? 1 / links : 0; + if (logOptions.recursive) { + gauge.show(`Links:${links} Pages:${checker.numPages} Sites:${checker.numSites}`, pageCompletion); + } else { + gauge.show(`Links:${links} Pages:${checker.numPages}`, pageCompletion); + } +}; +const logResult = /*(*/(result /*, finalResult)*/) => { + if (result.displayed) { + // @todo if the last result is skipped, the last RENDERED result will not be "└─" + let output = (0, _chalk.gray)( /*finalResult!==true ?*/"├─" /*: "└─"*/); + const { + link + } = result; + if (link.get(_Link.IS_BROKEN)) { + output += (0, _chalk.red)("BROKEN"); + output += (0, _chalk.gray)("─ "); + } else if (link.get(_Link.WAS_EXCLUDED)) { + output += (0, _chalk.gray)("─SKIP── "); + } else { + output += (0, _chalk.gray)("──"); + output += (0, _chalk.green)("OK"); + output += (0, _chalk.gray)("─── "); + } + + // @todo is ORIGINAL_URL only for invalid links? + output += (0, _chalk.yellow)(link.get(_Link.REBASED_URL) ?? link.get(_Link.ORIGINAL_URL)); + if (link.get(_Link.IS_BROKEN)) { + output += (0, _chalk.gray)(` (${link.get(_Link.BROKEN_REASON)})`); + } else if (link.get(_Link.WAS_EXCLUDED)) { + output += (0, _chalk.gray)(` (${link.get(_Link.EXCLUDED_REASON)})`); + } + // Don't display cached message if broken/excluded message is displayed + else if (link.get(_Link.HTTP_RESPONSE_WAS_CACHED)) { + output += (0, _chalk.gray)(" (CACHED)"); + } + log(output); + } +}; + +/** + * Logs links in the order that they are found in their containing HTML + * document, even if later links receive an earlier response. + */ +const logResults = () => { + // eslint-disable-next-line no-constant-condition + while (true) { + const result = stats.page.results[stats.page.currentIndex]; + if (result !== undefined) { + //const final = stats.page.currentIndex>=stats.page.results.length-1 && checker.numActiveLinks===0 && checker.numQueuedLinks===0; + + logResult(result /*, final*/); + stats.page.currentIndex++; + } else { + break; + } + } +}; +const logSite = () => { + let output = ""; + if (++stats.site.totalPages > 1) { + output += "\n"; + } + output += (0, _chalk.white)("\nStarting recursive scan..."); + log(output); +}; + +// @todo number of unique/uncached links +// @todo "excluded links" [from cli] doesn't make sense with a value of 0 when there're skipped links in the log +const logSiteMetrics = () => { + let output = ""; + output += (0, _chalk.gray)(`\nLinks found: ${stats.site.totalLinks}`); + output += (0, _chalk.gray)(`\nLinks skipped: ${stats.site.skippedLinks}`); + output += (0, _chalk.gray)(`\nLinks successful: ${stats.site.totalLinks - stats.site.skippedLinks - stats.site.brokenLinks}`); + let broken; + if (stats.site.totalLinks > 0) { + broken = stats.site.brokenLinks > 0 ? _chalk.red : _chalk.green; + } else { + broken = _chalk.gray; + } + output += broken(`\nLinks broken: ${stats.site.brokenLinks}`); + output += (0, _chalk.gray)("\nTime elapsed: "); + output += (0, _chalk.gray)((0, _humanizeDuration.default)(Date.now() - stats.site.startTime, { + largest: 2, + round: true + })); + const separator = (0, _chalk.gray)("=".repeat((0, _longest.default)((0, _stripAnsi.default)(output).split("\n")).length)); + log(`\n${separator}${output}\n${separator}\n`); +}; +const run = () => { + Object.values(_themes.themes).forEach(theme => { + //theme.preProgressbar = `\n\n${theme.preProgressbar}`; + theme.preSubsection = (0, _chalk.gray)("—"); + }); + gauge = new _gauge.default(); + stats = new Statistics(); + if (logOptions.recursive) { + checker = new _.SiteChecker(checkerOptions); + } else { + checker = new _.HtmlUrlChecker(checkerOptions); + } + checker.on(_events.HTML_EVENT, (tree, robots, response, pageURL) => { + logPage(pageURL); + }).on(_events.QUEUE_EVENT, () => { + logProgress(); + }).on(_events.JUNK_EVENT, link => { + stats.pushResult(link); + logProgress(); + logResults(); + }).on(_events.LINK_EVENT, link => { + stats.pushResult(link); + logProgress(); + logResults(); + }).on(_events.PAGE_EVENT, (error, pageURL) => { + if (error != null) { + // HTML_EVENT will not have been called + logPage(pageURL); + if (error.code < 200 || error.code > 299) { + log((0, _chalk.red)(`${error.name}: ${error.message}`)); + } else { + log((0, _chalk.gray)(`${error.name}: ${error.message}`)); + } + process.exitCode = 1; + } + // If more than a total of one page will be scanned + else if (logOptions.recursive || urls.length > 1) { + logPageMetrics(); + logProgress(); + stats.resetPage(); + + // If nothing after current page + if (checker.numPages === 1) { + logSiteMetrics(); + } + } else { + logSiteMetrics(); + } + }).on(_events.SITE_EVENT, () => { + logSiteMetrics(); + stats.resetSite(); + }).on(_events.END_EVENT, () => { + // @todo store multiple site stats in an array and log all site metrics at very end? + + if ((0, _supportsSemigraphics.default)()) { + // Exit gracefully + clearTimeout(spinner); + gauge.disable(); + keyScanner.release(); + + // @todo https://github.com/mikaelbr/node-notifier/issues/174 + _nodeNotifier.default.notify({ + message: "Finished!", + title + }); + } + }).on(_events.ERROR_EVENT, error => { + console.error(error); + + // eslint-disable-next-line no-process-exit + process.exit(1); + }); + if (logOptions.recursive) { + logSite(); + } + if ((0, _supportsSemigraphics.default)()) { + // Show pause message + togglePause(false); + keyScanner = (0, _keyscan.make_scanner)(key => { + if (key.parsed === "space") { + togglePause(); + } + }); + } else { + gauge.disable(); + } + try { + checker.pause(); // avoid auto-start + + urls.map(url => { + try { + url = new URL(url); + } catch { + url = (0, _url.pathToFileURL)(url); + } + return url; + }).forEach(url => checker.enqueue(url)); + checker.resume(); // start, if above didn't throw + } catch ({ + message + }) { + console.error(message); + process.exitCode = 1; + } +}; +const spinnerInterval = () => { + spinner = setTimeout(() => { + gauge.pulse(pauseMessage); + spinnerInterval(); + }, 50); +}; +class Statistics { + constructor() { + this.page = {}; + this.site = {}; + this.resetSite(); + } + pushResult(link) { + const result = { + displayed: true, + link + }; + const hideCachedLink = logOptions.hideCachedLinks && link.get(_Link.IS_BROKEN) === false && link.get(_Link.HTTP_RESPONSE_WAS_CACHED); + const hideSkippedLink = logOptions.hideSkippedLinks && link.get(_Link.WAS_EXCLUDED); + const hideUnbrokenLink = logOptions.hideUnbrokenLinks && link.get(_Link.IS_BROKEN) === false; + if (hideCachedLink || hideSkippedLink || hideUnbrokenLink) { + this.page.hiddenLinks++; + this.site.hiddenLinks++; + result.displayed = false; + } + if (link.get(_Link.IS_BROKEN)) { + this.page.brokenLinks++; + this.site.brokenLinks++; + process.exitCode = 1; + } else if (link.get(_Link.WAS_EXCLUDED)) { + this.page.skippedLinks++; + this.site.skippedLinks++; + } + this.page.totalLinks++; + this.site.totalLinks++; + if (logOptions.maintainLinkOrder) { + this.page.results[link.get(_Link.HTML_INDEX)] = result; + } else { + this.page.results.push(result); + } + } + resetPage() { + this.page.brokenLinks = 0; + this.page.currentIndex = 0; + this.page.hiddenLinks = 0; + this.page.results = []; + this.page.skippedLinks = 0; + //this.page.startTime = Date.now(); + this.page.totalLinks = 0; + } + resetSite() { + this.resetPage(); + this.site.brokenLinks = 0; + this.site.hiddenLinks = 0; + this.site.skippedLinks = 0; + this.site.startTime = Date.now(); + this.site.totalLinks = 0; + this.site.totalPages = 0; + } +} +const togglePause = pause => { + if (pause === undefined) { + pause = !checker.isPaused; + } + if (pause) { + checker.pause(); + pauseMessage = `${(0, _chalk.yellow)("PAUSED")}${(0, _chalk.gray)(" — press space to resume")}`; + gauge.pulse(pauseMessage); + clearTimeout(spinner); + } else { + checker.resume(); + pauseMessage = (0, _chalk.gray)("press space to pause"); + spinner = spinnerInterval(); + } + logProgress(); +}; +var _default = (args = process.argv) => { + const filterLevel = ["--filter-level:", " 0: clickable links", " 1: 0 + media, frames, meta refreshes", " 2: 1 + stylesheets, scripts, forms", " 3: 2 + metadata"].join("\n"); + const verbosity = ["--verbosity:", " 0: broken links", " 1: 0 + unbroken links", " 2: 1 + skipped links"].join("\n"); + + /* eslint-disable sort-keys */ + const optionator = require("optionator")({ + prepend: `${(0, _chalk.yellow)(title.toUpperCase())}\n\n${(0, _chalk.green)("Usage:")} blc [options] url1 [url2 ...]`, + append: `${(0, _chalk.gray)(filterLevel)}\n\n${(0, _chalk.gray)(verbosity)}\n`, + options: [{ + heading: "Common Options" + }, { + option: "recursive", + alias: "r", + type: "Boolean", + description: `Recursively scan ("crawl") the HTML document(s)`, + default: "false" + }, { + heading: "Filtering Options" + }, { + option: "exclude", + type: "[String]", + description: "Skip checking of links that match keywords/glob" + }, { + option: "exclude-external", + alias: "e", + type: "Boolean", + description: "Skip checking of external links", + default: "false" + }, { + option: "exclude-internal", + alias: "i", + type: "Boolean", + description: "Skip checking of internal links", + default: "false" + }, { + option: "filter-level", + type: "Number", + description: "Include checking of links by HTML properties", + default: `${_defaultOptions.default.filterLevel}` + }, { + option: "follow", + alias: "f", + type: "Boolean", + description: "Force-follow robot exclusions", + default: "false" + }, { + option: "include", + type: "[String]", + description: "Only check links that match keywords/glob" + }, { + heading: "Display Options" + }, { + option: "help", + alias: "h", + type: "Boolean", + description: "Display this help text", + default: "false" + }, { + option: "ordered", + alias: "o", + type: "Boolean", + description: "Maintain the order of links as they appear in their HTML document", + default: "false" + }, { + option: "verbosity", + type: "Number", + description: "The display verbosity level", + default: "1" + }, { + option: "version", + alias: "v", + type: "Boolean", + description: "Display the app version", + default: "false" + }, { + heading: "Advanced Options" + }, { + option: "get", + alias: "g", + type: "Boolean", + description: "Change request method to GET", + default: "false" + }, { + option: "host-requests", + type: "Number", + description: "Concurrent requests limit per host", + default: `${_defaultOptions.default.maxSocketsPerHost}` + }, { + option: "requests", + type: "Number", + description: "Concurrent requests limit ", + default: `${_defaultOptions.default.maxSockets}` + }, { + option: "user-agent", + type: "String", + description: "The user agent to use for checking links" + }] + }); + /* eslint-disable sort-keys */ + + try { + if (args === process.argv) { + args = optionator.parseArgv(args); + } else { + args = optionator.parse(args); + } + } catch (error) { + args = error; + } + if (args instanceof Error) { + console.error(args.message); + process.exitCode = 1; + } else if (args.help) { + console.log(optionator.generateHelp()); + } else if (args.version) { + console.log(_package.version); + } else if (args._.length > 0) { + urls = args._; + checkerOptions = argsToOptions(args); + logOptions = { + hideCachedLinks: args.verbosity < 2, + hideSkippedLinks: args.verbosity < 2, + hideUnbrokenLinks: args.verbosity < 1, + maintainLinkOrder: args.ordered, + recursive: args.recursive === true // default value is undefined + }; + run(); + } else { + console.error("At least one URL is required; see '--help'"); + process.exitCode = 1; + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/lib-cjs/cli.js.map b/lib-cjs/cli.js.map new file mode 100644 index 00000000..9bf7ee74 --- /dev/null +++ b/lib-cjs/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","names":["_Link","require","_defaultOptions","_interopRequireDefault","_events","_gauge","_httpMethodsConstants","_chalk","_","_humanizeDuration","_longest","_keyscan","_nodeNotifier","_url","_stripAnsi","_supportsSemigraphics","_themes","_package","obj","__esModule","default","title","checker","checkerOptions","gauge","keyScanner","logOptions","pauseMessage","spinner","stats","urls","argsToOptions","args","renames","exclude","excludeExternal","excludeInternal","follow","hostRequests","include","ordered","requests","Object","entries","reduce","opts","argName","argValue","DEFAULT_OPTIONS","get","requestMethod","GET","log","hide","console","show","logPage","pageURL","white","yellow","logPageMetrics","output","gray","page","totalLinks","skippedLinks","brokenLinks","red","green","logProgress","links","numActiveLinks","numQueuedLinks","pageCompletion","recursive","numPages","numSites","logResult","result","displayed","link","IS_BROKEN","WAS_EXCLUDED","REBASED_URL","ORIGINAL_URL","BROKEN_REASON","EXCLUDED_REASON","HTTP_RESPONSE_WAS_CACHED","logResults","results","currentIndex","undefined","logSite","site","totalPages","logSiteMetrics","broken","humanizeDuration","Date","now","startTime","largest","round","separator","repeat","longest","stripAnsi","split","length","run","values","gaugeThemes","forEach","theme","preSubsection","Gauge","Statistics","SiteChecker","HtmlUrlChecker","on","HTML_EVENT","tree","robots","response","QUEUE_EVENT","JUNK_EVENT","pushResult","LINK_EVENT","PAGE_EVENT","error","code","name","message","process","exitCode","resetPage","SITE_EVENT","resetSite","END_EVENT","supportsSemigraphics","clearTimeout","disable","release","notifier","notify","ERROR_EVENT","exit","togglePause","scanKeys","key","parsed","pause","map","url","URL","pathToFileURL","enqueue","resume","spinnerInterval","setTimeout","pulse","constructor","hideCachedLink","hideCachedLinks","hideSkippedLink","hideSkippedLinks","hideUnbrokenLink","hideUnbrokenLinks","hiddenLinks","maintainLinkOrder","HTML_INDEX","push","isPaused","_default","argv","filterLevel","join","verbosity","optionator","prepend","toUpperCase","append","options","heading","option","alias","type","description","maxSocketsPerHost","maxSockets","parseArgv","parse","Error","help","generateHelp","version","packageVersion","exports","module"],"sources":["../lib/cli.js"],"sourcesContent":["/* eslint-disable no-console */\nimport {BROKEN_REASON, EXCLUDED_REASON, HTML_INDEX, HTTP_RESPONSE_WAS_CACHED, IS_BROKEN, ORIGINAL_URL, REBASED_URL, WAS_EXCLUDED} from \"./internal/Link\";\nimport DEFAULT_OPTIONS from \"./internal/defaultOptions\";\nimport {END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT, SITE_EVENT} from \"./internal/events\";\nimport Gauge from \"gauge\";\nimport {GET} from \"http-methods-constants\";\nimport {gray, green, red, white, yellow} from \"chalk\";\nimport {HtmlUrlChecker, SiteChecker} from \"./\";\nimport humanizeDuration from \"humanize-duration\";\nimport longest from \"longest\";\nimport {make_scanner as scanKeys} from \"keyscan\";\nimport notifier from \"node-notifier\";\nimport {pathToFileURL} from \"url\";\nimport stripAnsi from \"strip-ansi\";\nimport supportsSemigraphics from \"supports-semigraphics\";\nimport {themes as gaugeThemes} from \"gauge/themes\";\nimport {version as packageVersion} from \"../package.json\";\n\n\n\nconst title = \"Broken Link Checker\";\nlet checker,checkerOptions,gauge,keyScanner,logOptions,pauseMessage,spinner,stats,urls;\n\n\n\nconst argsToOptions = args =>\n{\n\tconst renames =\n\t{\n\t\texclude: \"excludedKeywords\",\n\t\texcludeExternal: \"excludeExternalLinks\",\n\t\texcludeInternal: \"excludeInternalLinks\",\n\t\tfollow: \"followRobotExclusions\",\n\t\thostRequests: \"maxSocketsPerHost\",\n\t\tinclude: \"includedKeywords\",\n\t\tordered: \"maintainLinkOrder\",\n\t\trequests: \"maxSockets\"\n\t};\n\n\treturn Object.entries(args).reduce((opts, [argName, argValue]) =>\n\t{\n\t\tif (argName in renames)\n\t\t{\n\t\t\topts[ renames[argName] ] = argValue;\n\t\t}\n\t\telse if (argName in DEFAULT_OPTIONS)\n\t\t{\n\t\t\topts[argName] = argValue;\n\t\t}\n\t\telse if (args.get)\n\t\t{\n\t\t\topts.requestMethod = GET;\n\t\t}\n\n\t\treturn opts;\n\t}, {});\n};\n\n\n\nconst log = (...args) =>\n{\n\t// Avoid spinner/progress chars getting stuck in the log\n\tgauge.hide();\n\n\tconsole.log(...args);\n\n\tgauge.show();\n};\n\n\n\nconst logPage = pageURL =>\n{\n\tlog(`${white(\"\\nGetting links from:\")} ${yellow(pageURL)}`);\n};\n\n\n\nconst logPageMetrics = () =>\n{\n\tlet output = gray(`Finished! ${stats.page.totalLinks} links found.`);\n\n\tif (stats.page.skippedLinks > 0)\n\t{\n\t\toutput += gray(` ${stats.page.skippedLinks} skipped.`);\n\t}\n\n\tif (stats.page.totalLinks > 0)\n\t{\n\t\toutput += gray(\" \");\n\n\t\tif (stats.page.brokenLinks > 0)\n\t\t{\n\t\t\toutput += red(`${stats.page.brokenLinks} broken`);\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutput += green(`${stats.page.brokenLinks} broken`);\n\t\t}\n\n\t\toutput += gray(\".\");\n\t}\n\n\tlog(output);\n};\n\n\n\nconst logProgress = () =>\n{\n\tconst links = checker.numActiveLinks + checker.numQueuedLinks;\n\n\tconst pageCompletion = links>0 ? 1/links : 0;\n\n\tif (logOptions.recursive)\n\t{\n\t\tgauge.show(`Links:${links} Pages:${checker.numPages} Sites:${checker.numSites}`, pageCompletion);\n\t}\n\telse\n\t{\n\t\tgauge.show(`Links:${links} Pages:${checker.numPages}`, pageCompletion);\n\t}\n};\n\n\n\nconst logResult = /*(*/result/*, finalResult)*/ =>\n{\n\tif (result.displayed)\n\t{\n\t\t// @todo if the last result is skipped, the last RENDERED result will not be \"└─\"\n\t\tlet output = gray( /*finalResult!==true ?*/ \"├─\" /*: \"└─\"*/ );\n\n\t\tconst {link} = result;\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\toutput += red(\"BROKEN\");\n\t\t\toutput += gray(\"─ \");\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\toutput += gray(\"─SKIP── \");\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutput += gray(\"──\");\n\t\t\toutput += green(\"OK\");\n\t\t\toutput += gray(\"─── \");\n\t\t}\n\n\t\t// @todo is ORIGINAL_URL only for invalid links?\n\t\toutput += yellow( link.get(REBASED_URL) ?? link.get(ORIGINAL_URL) );\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\toutput += gray(` (${link.get(BROKEN_REASON)})`);\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\toutput += gray(` (${link.get(EXCLUDED_REASON)})`);\n\t\t}\n\t\t// Don't display cached message if broken/excluded message is displayed\n\t\telse if (link.get(HTTP_RESPONSE_WAS_CACHED))\n\t\t{\n\t\t\toutput += gray(\" (CACHED)\");\n\t\t}\n\n\t\tlog(output);\n\t}\n};\n\n\n\n/**\n * Logs links in the order that they are found in their containing HTML\n * document, even if later links receive an earlier response.\n */\nconst logResults = () =>\n{\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true)\n\t{\n\t\tconst result = stats.page.results[stats.page.currentIndex];\n\n\t\tif (result !== undefined)\n\t\t{\n\t\t\t//const final = stats.page.currentIndex>=stats.page.results.length-1 && checker.numActiveLinks===0 && checker.numQueuedLinks===0;\n\n\t\t\tlogResult(result/*, final*/);\n\n\t\t\tstats.page.currentIndex++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n};\n\n\n\nconst logSite = () =>\n{\n\tlet output = \"\";\n\n\tif (++stats.site.totalPages > 1)\n\t{\n\t\toutput += \"\\n\";\n\t}\n\n\toutput += white(\"\\nStarting recursive scan...\");\n\n\tlog(output);\n};\n\n\n\n// @todo number of unique/uncached links\n// @todo \"excluded links\" [from cli] doesn't make sense with a value of 0 when there're skipped links in the log\nconst logSiteMetrics = () =>\n{\n\tlet output = \"\";\n\toutput += gray(`\\nLinks found: ${stats.site.totalLinks}`);\n\toutput += gray(`\\nLinks skipped: ${stats.site.skippedLinks}`);\n\toutput += gray(`\\nLinks successful: ${stats.site.totalLinks - stats.site.skippedLinks - stats.site.brokenLinks}`);\n\n\tlet broken;\n\n\tif (stats.site.totalLinks > 0)\n\t{\n\t\tbroken = stats.site.brokenLinks>0 ? red : green;\n\t}\n\telse\n\t{\n\t\tbroken = gray;\n\t}\n\n\toutput += broken(`\\nLinks broken: ${stats.site.brokenLinks}`);\n\toutput += gray(\"\\nTime elapsed: \");\n\toutput += gray( humanizeDuration(Date.now() - stats.site.startTime, {largest:2, round:true}) );\n\n\tconst separator = gray(\"=\".repeat( longest(stripAnsi(output).split(\"\\n\")).length ));\n\n\tlog(`\\n${separator}${output}\\n${separator}\\n`);\n};\n\n\n\nconst run = () =>\n{\n\tObject.values(gaugeThemes).forEach(theme =>\n\t{\n\t\t//theme.preProgressbar = `\\n\\n${theme.preProgressbar}`;\n\t\ttheme.preSubsection = gray(\"—\");\n\t});\n\n\tgauge = new Gauge();\n\tstats = new Statistics();\n\n\tif (logOptions.recursive)\n\t{\n\t\tchecker = new SiteChecker(checkerOptions);\n\t}\n\telse\n\t{\n\t\tchecker = new HtmlUrlChecker(checkerOptions);\n\t}\n\n\tchecker\n\t.on(HTML_EVENT, (tree, robots, response, pageURL) =>\n\t{\n\t\tlogPage(pageURL);\n\t})\n\t.on(QUEUE_EVENT, () =>\n\t{\n\t\tlogProgress();\n\t})\n\t.on(JUNK_EVENT, link =>\n\t{\n\t\tstats.pushResult(link);\n\t\tlogProgress();\n\t\tlogResults();\n\t})\n\t.on(LINK_EVENT, link =>\n\t{\n\t\tstats.pushResult(link);\n\t\tlogProgress();\n\t\tlogResults();\n\t})\n\t.on(PAGE_EVENT, (error, pageURL) =>\n\t{\n\t\tif (error != null)\n\t\t{\n\t\t\t// HTML_EVENT will not have been called\n\t\t\tlogPage(pageURL);\n\n\t\t\tif (error.code<200 || error.code>299)\n\t\t\t{\n\t\t\t\tlog( red(`${error.name}: ${error.message}`) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog( gray(`${error.name}: ${error.message}`) );\n\t\t\t}\n\n\t\t\tprocess.exitCode = 1;\n\t\t}\n\t\t// If more than a total of one page will be scanned\n\t\telse if (logOptions.recursive || urls.length>1)\n\t\t{\n\t\t\tlogPageMetrics();\n\t\t\tlogProgress();\n\t\t\tstats.resetPage();\n\n\t\t\t// If nothing after current page\n\t\t\tif (checker.numPages === 1)\n\t\t\t{\n\t\t\t\tlogSiteMetrics();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlogSiteMetrics();\n\t\t}\n\t})\n\t.on(SITE_EVENT, () =>\n\t{\n\t\tlogSiteMetrics();\n\t\tstats.resetSite();\n\t})\n\t.on(END_EVENT, () =>\n\t{\n\t\t// @todo store multiple site stats in an array and log all site metrics at very end?\n\n\t\tif (supportsSemigraphics())\n\t\t{\n\t\t\t// Exit gracefully\n\t\t\tclearTimeout(spinner);\n\t\t\tgauge.disable();\n\t\t\tkeyScanner.release();\n\n\t\t\t// @todo https://github.com/mikaelbr/node-notifier/issues/174\n\t\t\tnotifier.notify({ message:\"Finished!\", title });\n\t\t}\n\t})\n\t.on(ERROR_EVENT, error =>\n\t{\n\t\tconsole.error(error);\n\n\t\t// eslint-disable-next-line no-process-exit\n\t\tprocess.exit(1);\n\t});\n\n\tif (logOptions.recursive)\n\t{\n\t\tlogSite();\n\t}\n\n\tif (supportsSemigraphics())\n\t{\n\t\t// Show pause message\n\t\ttogglePause(false);\n\n\t\tkeyScanner = scanKeys(key =>\n\t\t{\n\t\t\tif (key.parsed === \"space\")\n\t\t\t{\n\t\t\t\ttogglePause();\n\t\t\t}\n\t\t});\n\t}\n\telse\n\t{\n\t\tgauge.disable();\n\t}\n\n\ttry\n\t{\n\t\tchecker.pause(); // avoid auto-start\n\n\t\turls\n\t\t.map(url =>\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\turl = new URL(url);\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\turl = pathToFileURL(url);\n\t\t\t}\n\n\t\t\treturn url;\n\t\t})\n\t\t.forEach(url => checker.enqueue(url));\n\n\t\tchecker.resume(); // start, if above didn't throw\n\t}\n\tcatch ({message})\n\t{\n\t\tconsole.error(message);\n\t\tprocess.exitCode = 1;\n\t}\n};\n\n\n\nconst spinnerInterval = () =>\n{\n\tspinner = setTimeout(() =>\n\t{\n\t\tgauge.pulse(pauseMessage);\n\t\tspinnerInterval();\n\t}, 50);\n};\n\n\n\nclass Statistics\n{\n\tconstructor()\n\t{\n\t\tthis.page = {};\n\t\tthis.site = {};\n\t\tthis.resetSite();\n\t}\n\n\tpushResult(link)\n\t{\n\t\tconst result = { displayed:true, link };\n\n\t\tconst hideCachedLink = logOptions.hideCachedLinks && link.get(IS_BROKEN)===false && link.get(HTTP_RESPONSE_WAS_CACHED);\n\t\tconst hideSkippedLink = logOptions.hideSkippedLinks && link.get(WAS_EXCLUDED);\n\t\tconst hideUnbrokenLink = logOptions.hideUnbrokenLinks && link.get(IS_BROKEN)===false;\n\n\t\tif (hideCachedLink || hideSkippedLink || hideUnbrokenLink)\n\t\t{\n\t\t\tthis.page.hiddenLinks++;\n\t\t\tthis.site.hiddenLinks++;\n\t\t\tresult.displayed = false;\n\t\t}\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\tthis.page.brokenLinks++;\n\t\t\tthis.site.brokenLinks++;\n\t\t\tprocess.exitCode = 1;\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\tthis.page.skippedLinks++;\n\t\t\tthis.site.skippedLinks++;\n\t\t}\n\n\t\tthis.page.totalLinks++;\n\t\tthis.site.totalLinks++;\n\n\t\tif (logOptions.maintainLinkOrder)\n\t\t{\n\t\t\tthis.page.results[link.get(HTML_INDEX)] = result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.page.results.push(result);\n\t\t}\n\t}\n\n\tresetPage()\n\t{\n\t\tthis.page.brokenLinks = 0;\n\t\tthis.page.currentIndex = 0;\n\t\tthis.page.hiddenLinks = 0;\n\t\tthis.page.results = [];\n\t\tthis.page.skippedLinks = 0;\n\t\t//this.page.startTime = Date.now();\n\t\tthis.page.totalLinks = 0;\n\t}\n\n\tresetSite()\n\t{\n\t\tthis.resetPage();\n\t\tthis.site.brokenLinks = 0;\n\t\tthis.site.hiddenLinks = 0;\n\t\tthis.site.skippedLinks = 0;\n\t\tthis.site.startTime = Date.now();\n\t\tthis.site.totalLinks = 0;\n\t\tthis.site.totalPages = 0;\n\t}\n}\n\n\n\nconst togglePause = pause =>\n{\n\tif (pause === undefined)\n\t{\n\t\tpause = !checker.isPaused;\n\t}\n\n\tif (pause)\n\t{\n\t\tchecker.pause();\n\n\t\tpauseMessage = `${yellow(\"PAUSED\")}${gray(\" — press space to resume\")}`;\n\t\tgauge.pulse(pauseMessage);\n\t\tclearTimeout(spinner);\n\t}\n\telse\n\t{\n\t\tchecker.resume();\n\n\t\tpauseMessage = gray(\"press space to pause\");\n\t\tspinner = spinnerInterval();\n\t}\n\n\tlogProgress();\n};\n\n\n\nexport default (args=process.argv) =>\n{\n\tconst filterLevel =\n\t[\n\t\t\"--filter-level:\",\n\t\t\" 0: clickable links\",\n\t\t\" 1: 0 + media, frames, meta refreshes\",\n\t\t\" 2: 1 + stylesheets, scripts, forms\",\n\t\t\" 3: 2 + metadata\"\n\t].join(\"\\n\");\n\n\tconst verbosity =\n\t[\n\t\t\"--verbosity:\",\n\t\t\" 0: broken links\",\n\t\t\" 1: 0 + unbroken links\",\n\t\t\" 2: 1 + skipped links\"\n\t].join(\"\\n\");\n\n\t/* eslint-disable sort-keys */\n\tconst optionator = require(\"optionator\")(\n\t{\n\t\tprepend: `${yellow(title.toUpperCase())}\\n\\n${green(\"Usage:\")} blc [options] url1 [url2 ...]`,\n\t\tappend: `${gray(filterLevel)}\\n\\n${gray(verbosity)}\\n`,\n\t\toptions:\n\t\t[\n\t\t\t{ heading:\"Common Options\" },\n\t\t\t{ option:\"recursive\", alias:\"r\", type:\"Boolean\", description:`Recursively scan (\"crawl\") the HTML document(s)`, default:\"false\" },\n\n\t\t\t{ heading:\"Filtering Options\" },\n\t\t\t{ option:\"exclude\", type:\"[String]\", description:\"Skip checking of links that match keywords/glob\" },\n\t\t\t{ option:\"exclude-external\", alias:\"e\", type:\"Boolean\", description:\"Skip checking of external links\", default:\"false\" },\n\t\t\t{ option:\"exclude-internal\", alias:\"i\", type:\"Boolean\", description:\"Skip checking of internal links\", default:\"false\" },\n\t\t\t{ option:\"filter-level\", type:\"Number\", description:\"Include checking of links by HTML properties\", default:`${DEFAULT_OPTIONS.filterLevel}` },\n\t\t\t{ option:\"follow\", alias:\"f\", type:\"Boolean\", description:\"Force-follow robot exclusions\", default:\"false\" },\n\t\t\t{ option:\"include\", type:\"[String]\", description:\"Only check links that match keywords/glob\" },\n\n\t\t\t{ heading:\"Display Options\" },\n\t\t\t{ option:\"help\", alias:\"h\", type:\"Boolean\", description:\"Display this help text\", default:\"false\" },\n\t\t\t{ option:\"ordered\", alias:\"o\", type:\"Boolean\", description:\"Maintain the order of links as they appear in their HTML document\", default:\"false\" },\n\t\t\t{ option:\"verbosity\", type:\"Number\", description:\"The display verbosity level\", default:\"1\" },\n\t\t\t{ option:\"version\", alias:\"v\", type:\"Boolean\", description:\"Display the app version\", default:\"false\" },\n\n\t\t\t{ heading:\"Advanced Options\" },\n\t\t\t{ option:\"get\", alias:\"g\", type:\"Boolean\", description:\"Change request method to GET\", default:\"false\" },\n\t\t\t{ option:\"host-requests\", type:\"Number\", description:\"Concurrent requests limit per host\", default:`${DEFAULT_OPTIONS.maxSocketsPerHost}` },\n\t\t\t{ option:\"requests\", type:\"Number\", description:\"Concurrent requests limit \", default:`${DEFAULT_OPTIONS.maxSockets}` },\n\t\t\t{ option:\"user-agent\", type:\"String\", description:\"The user agent to use for checking links\" }\n\t\t]\n\t});\n\t/* eslint-disable sort-keys */\n\n\ttry\n\t{\n\t\tif (args === process.argv)\n\t\t{\n\t\t\targs = optionator.parseArgv(args);\n\t\t}\n\t\telse\n\t\t{\n\t\t\targs = optionator.parse(args);\n\t\t}\n\t}\n\tcatch (error)\n\t{\n\t\targs = error;\n\t}\n\n\tif (args instanceof Error)\n\t{\n\t\tconsole.error(args.message);\n\t\tprocess.exitCode = 1;\n\t}\n\telse if (args.help)\n\t{\n\t\tconsole.log( optionator.generateHelp() );\n\t}\n\telse if (args.version)\n\t{\n\t\tconsole.log(packageVersion);\n\t}\n\telse if (args._.length > 0)\n\t{\n\t\turls = args._;\n\t\tcheckerOptions = argsToOptions(args);\n\t\tlogOptions =\n\t\t{\n\t\t\thideCachedLinks: args.verbosity < 2,\n\t\t\thideSkippedLinks: args.verbosity < 2,\n\t\t\thideUnbrokenLinks: args.verbosity < 1,\n\t\t\tmaintainLinkOrder: args.ordered,\n\t\t\trecursive: args.recursive === true // default value is undefined\n\t\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OAAA,CAAAjL,OAAA,GAAAyJ,QAAA;AAAAyB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjL,OAAA"} \ No newline at end of file diff --git a/lib-cjs/index.js b/lib-cjs/index.js new file mode 100644 index 00000000..4ec7bff9 --- /dev/null +++ b/lib-cjs/index.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + reasons: true, + DEFAULT_OPTIONS: true, + HtmlChecker: true, + HtmlUrlChecker: true, + SiteChecker: true, + UrlChecker: true +}; +Object.defineProperty(exports, "DEFAULT_OPTIONS", { + enumerable: true, + get: function () { + return _defaultOptions.default; + } +}); +Object.defineProperty(exports, "HtmlChecker", { + enumerable: true, + get: function () { + return _HtmlChecker.default; + } +}); +Object.defineProperty(exports, "HtmlUrlChecker", { + enumerable: true, + get: function () { + return _HtmlUrlChecker.default; + } +}); +Object.defineProperty(exports, "SiteChecker", { + enumerable: true, + get: function () { + return _SiteChecker.default; + } +}); +Object.defineProperty(exports, "UrlChecker", { + enumerable: true, + get: function () { + return _UrlChecker.default; + } +}); +exports.reasons = void 0; +var _events = require("./internal/events"); +Object.keys(_events).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _events[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _events[key]; + } + }); +}); +var _reasons = _interopRequireWildcard(require("./internal/reasons")); +exports.reasons = _reasons; +var _defaultOptions = _interopRequireDefault(require("./internal/defaultOptions")); +var _HtmlChecker = _interopRequireDefault(require("./public/HtmlChecker")); +var _HtmlUrlChecker = _interopRequireDefault(require("./public/HtmlUrlChecker")); +var _SiteChecker = _interopRequireDefault(require("./public/SiteChecker")); +var _UrlChecker = _interopRequireDefault(require("./public/UrlChecker")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib-cjs/index.js.map b/lib-cjs/index.js.map new file mode 100644 index 00000000..5c0ac433 --- /dev/null +++ b/lib-cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_events","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_reasons","_interopRequireWildcard","reasons","_defaultOptions","_interopRequireDefault","_HtmlChecker","_HtmlUrlChecker","_SiteChecker","_UrlChecker","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["../lib/index.js"],"sourcesContent":["export * from \"./internal/events\";\nexport * as reasons from \"./internal/reasons\";\n\n// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as DEFAULT_OPTIONS} from \"./internal/defaultOptions\";\nexport {default as HtmlChecker} from \"./public/HtmlChecker\";\nexport {default as HtmlUrlChecker} from \"./public/HtmlUrlChecker\";\nexport {default as SiteChecker} from \"./public/SiteChecker\";\nexport {default as UrlChecker} from \"./public/UrlChecker\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,W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AAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAjB,GAAA,CAAAc,CAAA,OAAAK,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAhC,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAiC,wBAAA,WAAAC,CAAA,IAAAT,CAAA,oBAAAS,CAAA,IAAAlC,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAmB,CAAA,EAAAS,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAhC,MAAA,CAAAiC,wBAAA,CAAAR,CAAA,EAAAS,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAxB,GAAA,IAAAwB,CAAA,CAAAC,GAAA,IAAApC,MAAA,CAAAS,cAAA,CAAAqB,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAT,CAAA,CAAAS,CAAA,YAAAJ,CAAA,CAAAP,OAAA,GAAAE,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAQ,GAAA,CAAAX,CAAA,EAAAK,CAAA,GAAAA,CAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/Link.js b/lib-cjs/internal/Link.js new file mode 100644 index 00000000..6f87b915 --- /dev/null +++ b/lib-cjs/internal/Link.js @@ -0,0 +1,232 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.WAS_EXCLUDED = exports.RESOLVED_URL = exports.RESOLVED_BASE_URL = exports.REDIRECTED_URL = exports.REBASED_URL = exports.REBASED_BASE_URL = exports.ORIGINAL_URL = exports.IS_SAME_PAGE = exports.IS_INTERNAL = exports.IS_BROKEN = exports.HTTP_RESPONSE_WAS_CACHED = exports.HTTP_RESPONSE = exports.HTML_TEXT = exports.HTML_TAG_NAME = exports.HTML_TAG = exports.HTML_SELECTOR = exports.HTML_OFFSET_INDEX = exports.HTML_LOCATION = exports.HTML_INDEX = exports.HTML_BASE_HREF = exports.HTML_ATTR_NAME = exports.HTML_ATTRS = exports.EXCLUDED_REASON = exports.BROKEN_REASON = void 0; +var reasons = _interopRequireWildcard(require("./reasons")); +var _isurl = _interopRequireDefault(require("isurl")); +var _urlRelation = _interopRequireDefault(require("url-relation")); +var _class; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); } +function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } +function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; } +const ORIGINAL_URL = exports.ORIGINAL_URL = "originalURL"; // The URL string as it was inputted +const RESOLVED_URL = exports.RESOLVED_URL = "resolvedURL"; // The `URL`, resolved with `RESOLVED_BASE_URL` +const REBASED_URL = exports.REBASED_URL = "rebasedURL"; // The `URL`, resolved with `REBASED_BASE_URL` +const REDIRECTED_URL = exports.REDIRECTED_URL = "redirectedURL"; // The `URL`, after its last redirection, if any + +const RESOLVED_BASE_URL = exports.RESOLVED_BASE_URL = "resolvedBaseURL"; // The base `URL` +const REBASED_BASE_URL = exports.REBASED_BASE_URL = "rebasedBaseURL"; // The base `URL`, resolved with `HTML_BASE_HREF` + +const HTML_INDEX = exports.HTML_INDEX = "htmlIndex"; // The order in which the link appeared in its document -- out of all links using max-level tag filter +const HTML_OFFSET_INDEX = exports.HTML_OFFSET_INDEX = "htmlOffsetIndex"; // Sequential (gap-free) indices for skipped and unskipped links +const HTML_LOCATION = exports.HTML_LOCATION = "htmlLocation"; // Source code location of the attribute that the link was found within +const HTML_SELECTOR = exports.HTML_SELECTOR = "htmlSelector"; // CSS selector for element in document +const HTML_TAG_NAME = exports.HTML_TAG_NAME = "htmlTagName"; // Tag name that the link was found on +const HTML_ATTR_NAME = exports.HTML_ATTR_NAME = "htmlAttrName"; // Attribute name that the link was found within +const HTML_ATTRS = exports.HTML_ATTRS = "htmlAttrs"; // All attributes on the element +const HTML_TEXT = exports.HTML_TEXT = "htmlText"; // TextNodes/innerText of the element +const HTML_TAG = exports.HTML_TAG = "htmlTag"; // The entire tag string +const HTML_BASE_HREF = exports.HTML_BASE_HREF = "htmlBaseHref"; // The document's `` value + +const HTTP_RESPONSE = exports.HTTP_RESPONSE = "httpResponse"; // The request response +const HTTP_RESPONSE_WAS_CACHED = exports.HTTP_RESPONSE_WAS_CACHED = "httpResponseWasCached"; // If the response was from cache + +const IS_BROKEN = exports.IS_BROKEN = "isBroken"; // If the link was determined to be broken or not +const IS_INTERNAL = exports.IS_INTERNAL = "isInternal"; // If the link is to the same host as its base/document +const IS_SAME_PAGE = exports.IS_SAME_PAGE = "isSamePage"; // If the link is to the same page as its base/document +const WAS_EXCLUDED = exports.WAS_EXCLUDED = "wasExcluded"; // If the link was excluded due to any filtering + +const BROKEN_REASON = exports.BROKEN_REASON = "brokenReason"; // The reason why the link was considered broken, if it indeed is +const EXCLUDED_REASON = exports.EXCLUDED_REASON = "excludedReason"; // The reason why the link was excluded from being checked, if it indeed was +var _relateWithBase = /*#__PURE__*/new WeakSet(); +class Link extends Map { + /** + * @param {Link} [link] + */ + constructor(link) { + super(link); + /** + * Reassign properties associated with state relative to the link's environment. + */ + _classPrivateMethodInitSpec(this, _relateWithBase); + if (!(link instanceof Link)) { + // Default values + keys.forEach(key => super.set(key, null)); + } + } + + /** + * Change state to "broken" with a reason. + * @param {string} reasonKey + * @returns {Link} + */ + break(reasonKey) { + if (!(reasonKey in reasons)) { + reasonKey = "BLC_UNKNOWN"; + } + super.set(IS_BROKEN, true); + super.set(BROKEN_REASON, reasonKey); + this.include(); + return this; + } + + /** + * Change state to "excluded" with a reason. + * @param {string} reasonKey + * @returns {Link} + */ + exclude(reasonKey) { + super.set(WAS_EXCLUDED, true); + super.set(EXCLUDED_REASON, reasonKey); + return this; + } + + /** + * Change state to "not excluded" and remove any previous reason for being otherwise. + * @returns {Link} + */ + include() { + super.set(WAS_EXCLUDED, false); + super.set(EXCLUDED_REASON, null); + return this; + } + + /** + * Change state to "not broken" and remove any previous reason for being otherwise. + * @returns {Link} + */ + mend() { + super.set(IS_BROKEN, false); + super.set(BROKEN_REASON, null); + this.include(); + return this; + } + + /** + * Assign a redirected URL and change any relative state. + * @param {URL|string} url + * @returns {Link} + */ + redirect(url) { + super.set(REDIRECTED_URL, parseURL(url)); + _classPrivateMethodGet(this, _relateWithBase, _relateWithBase2).call(this); + return this; + } + /** + * Produce and assign an absolute URL and change any relative state. + * @param {URL|string|null} [url] + * @param {URL|string|null} [base] + * @returns {Link} + */ + resolve(url, base) { + if (url != null) { + // Parse or clone + base = parseURL(base); + if ((0, _isurl.default)(url)) { + super.set(ORIGINAL_URL, url.href); + super.set(RESOLVED_URL, url); + } else { + super.set(ORIGINAL_URL, url); + super.set(RESOLVED_URL, parseURL(url)); + } + if (base !== null) { + // Remove any hash since it's useless in a base -- safe to mutate + base.hash = ""; + const rebased = parseURL(super.get(HTML_BASE_HREF), base); + super.set(REBASED_BASE_URL, rebased ?? base); + super.set(RESOLVED_BASE_URL, base); + } else { + super.set(REBASED_BASE_URL, parseURL(super.get(HTML_BASE_HREF))); + } + if (super.get(REBASED_BASE_URL) !== null) { + // Remove any hash since it's useless in a base -- safe to mutate + super.get(REBASED_BASE_URL).hash = ""; + if (super.get(RESOLVED_URL) === null) { + super.set(RESOLVED_URL, parseURL(url, super.get(RESOLVED_BASE_URL))); + super.set(REBASED_URL, parseURL(url, super.get(REBASED_BASE_URL))); + } else { + super.set(REBASED_URL, super.get(RESOLVED_URL)); + } + } else { + super.set(REBASED_URL, super.get(RESOLVED_URL)); + } + + // @todo move relation stuff out of this function -- separation of concerns? + _classPrivateMethodGet(this, _relateWithBase, _relateWithBase2).call(this); + } + return this; + } + + /** + * Assign a value to a supported key. + * @param {symbol} key + * @param {*} value + * @throws {TypeError} unsupported key or undefined value + * @returns {Link} + */ + set(key, value) { + if (!keys.includes(key)) { + throw new TypeError("Invalid key"); + } else if (value === undefined) { + throw new TypeError("Invalid value"); + } else { + return super.set(key, value); + } + } + + /** + * Produce a key-value object for `JSON.stringify()`. + * @returns {object} + */ + toJSON() { + // @todo https://github.com/tc39/proposal-pipeline-operator + return Object.fromEntries(Array.from(super.entries())); + } +} +exports.default = Link; +_class = Link; +function _relateWithBase2() { + const url = _get(_getPrototypeOf(_class.prototype), "get", this).call(this, REDIRECTED_URL) ?? _get(_getPrototypeOf(_class.prototype), "get", this).call(this, REBASED_URL); + + // If impossible to determine is linked to same server/etc + if (url === null || _get(_getPrototypeOf(_class.prototype), "get", this).call(this, RESOLVED_BASE_URL) === null) { + // Overwrite any previous values + _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_INTERNAL, null); + _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_SAME_PAGE, null); + } else { + // Rebased base URL not used because `` URL could be remote + // @todo common/careful profile + // @todo auth shouldn't affect this + const relation = new _urlRelation.default(url, _get(_getPrototypeOf(_class.prototype), "get", this).call(this, RESOLVED_BASE_URL)); + _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_INTERNAL, relation.upTo(_urlRelation.default.HOST)); + _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_SAME_PAGE, relation.upTo(_urlRelation.default.PATH)); + } +} +const keys = [BROKEN_REASON, EXCLUDED_REASON, HTML_ATTR_NAME, HTML_ATTRS, HTML_BASE_HREF, HTML_INDEX, HTML_LOCATION, HTML_OFFSET_INDEX, HTML_SELECTOR, HTML_TAG, HTML_TAG_NAME, HTML_TEXT, HTTP_RESPONSE, HTTP_RESPONSE_WAS_CACHED, IS_BROKEN, IS_INTERNAL, IS_SAME_PAGE, ORIGINAL_URL, REBASED_BASE_URL, REBASED_URL, REDIRECTED_URL, RESOLVED_BASE_URL, RESOLVED_URL, WAS_EXCLUDED]; + +/** + * Parse or clone a URL. + * @param {URL|string|null} [url] + * @param {URL|string|null} [base] + * @returns {URL|null} + */ +const parseURL = (url = null, base) => { + if (url !== null) { + try { + url = new URL(url, base); + } catch { + url = null; + } + } + return url; +}; +Object.freeze(Link); +//# sourceMappingURL=Link.js.map \ No newline at end of file diff --git a/lib-cjs/internal/Link.js.map b/lib-cjs/internal/Link.js.map new file mode 100644 index 00000000..cff10a78 --- /dev/null +++ b/lib-cjs/internal/Link.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Link.js","names":["reasons","_interopRequireWildcard","require","_isurl","_interopRequireDefault","_urlRelation","_class","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","privateCollection","TypeError","_get","Reflect","bind","target","property","receiver","base","_superPropBase","desc","arguments","length","value","apply","object","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","_classPrivateMethodGet","fn","ORIGINAL_URL","exports","RESOLVED_URL","REBASED_URL","REDIRECTED_URL","RESOLVED_BASE_URL","REBASED_BASE_URL","HTML_INDEX","HTML_OFFSET_INDEX","HTML_LOCATION","HTML_SELECTOR","HTML_TAG_NAME","HTML_ATTR_NAME","HTML_ATTRS","HTML_TEXT","HTML_TAG","HTML_BASE_HREF","HTTP_RESPONSE","HTTP_RESPONSE_WAS_CACHED","IS_BROKEN","IS_INTERNAL","IS_SAME_PAGE","WAS_EXCLUDED","BROKEN_REASON","EXCLUDED_REASON","_relateWithBase","WeakSet","Link","Map","constructor","link","keys","forEach","key","break","reasonKey","include","exclude","mend","redirect","url","parseURL","_relateWithBase2","resolve","isURL","href","hash","rebased","includes","undefined","toJSON","fromEntries","Array","from","entries","relation","URLRelation","upTo","HOST","PATH","URL","freeze"],"sources":["../../lib/internal/Link.js"],"sourcesContent":["import * as reasons from \"./reasons\";\nimport isURL from \"isurl\";\nimport URLRelation from \"url-relation\";\n\n\n\nexport const ORIGINAL_URL = \"originalURL\"; // The URL string as it was inputted\nexport const RESOLVED_URL = \"resolvedURL\"; // The `URL`, resolved with `RESOLVED_BASE_URL`\nexport const REBASED_URL = \"rebasedURL\"; // The `URL`, resolved with `REBASED_BASE_URL`\nexport const REDIRECTED_URL = \"redirectedURL\"; // The `URL`, after its last redirection, if any\n\nexport const RESOLVED_BASE_URL = \"resolvedBaseURL\"; // The base `URL`\nexport const REBASED_BASE_URL = \"rebasedBaseURL\"; // The base `URL`, resolved with `HTML_BASE_HREF`\n\nexport const HTML_INDEX = \"htmlIndex\"; // The order in which the link appeared in its document -- out of all links using max-level tag filter\nexport const HTML_OFFSET_INDEX = \"htmlOffsetIndex\"; // Sequential (gap-free) indices for skipped and unskipped links\nexport const HTML_LOCATION = \"htmlLocation\"; // Source code location of the attribute that the link was found within\nexport const HTML_SELECTOR = \"htmlSelector\"; // CSS selector for element in document\nexport const HTML_TAG_NAME = \"htmlTagName\"; // Tag name that the link was found on\nexport const HTML_ATTR_NAME = \"htmlAttrName\"; // Attribute name that the link was found within\nexport const HTML_ATTRS = \"htmlAttrs\"; // All attributes on the element\nexport const HTML_TEXT = \"htmlText\"; // TextNodes/innerText of the element\nexport const HTML_TAG = \"htmlTag\"; // The entire tag string\nexport const HTML_BASE_HREF = \"htmlBaseHref\"; // The document's `` value\n\nexport const HTTP_RESPONSE = \"httpResponse\"; // The request response\nexport const HTTP_RESPONSE_WAS_CACHED = \"httpResponseWasCached\"; // If the response was from cache\n\nexport const IS_BROKEN = \"isBroken\"; // If the link was determined to be broken or not\nexport const IS_INTERNAL = \"isInternal\"; // If the link is to the same host as its base/document\nexport const IS_SAME_PAGE = \"isSamePage\"; // If the link is to the same page as its base/document\nexport const WAS_EXCLUDED = \"wasExcluded\"; // If the link was excluded due to any filtering\n\nexport const BROKEN_REASON = \"brokenReason\"; // The reason why the link was considered broken, if it indeed is\nexport const EXCLUDED_REASON = \"excludedReason\"; // The reason why the link was excluded from being checked, if it indeed was\n\n\n\nexport default class Link extends Map\n{\n\t/**\n\t * @param {Link} [link]\n\t */\n\tconstructor(link)\n\t{\n\t\tsuper(link);\n\n\t\tif (!(link instanceof Link))\n\t\t{\n\t\t\t// Default values\n\t\t\tkeys.forEach(key => super.set(key, null));\n\t\t}\n\t}\n\n\n\t/**\n\t * Change state to \"broken\" with a reason.\n\t * @param {string} reasonKey\n\t * @returns {Link}\n\t */\n\tbreak(reasonKey)\n\t{\n\t\tif (!(reasonKey in reasons))\n\t\t{\n\t\t\treasonKey = \"BLC_UNKNOWN\";\n\t\t}\n\n\t\tsuper.set(IS_BROKEN, true);\n\t\tsuper.set(BROKEN_REASON, reasonKey);\n\t\tthis.include();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"excluded\" with a reason.\n\t * @param {string} reasonKey\n\t * @returns {Link}\n\t */\n\texclude(reasonKey)\n\t{\n\t\tsuper.set(WAS_EXCLUDED, true);\n\t\tsuper.set(EXCLUDED_REASON, reasonKey);\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"not excluded\" and remove any previous reason for being otherwise.\n\t * @returns {Link}\n\t */\n\tinclude()\n\t{\n\t\tsuper.set(WAS_EXCLUDED, false);\n\t\tsuper.set(EXCLUDED_REASON, null);\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"not broken\" and remove any previous reason for being otherwise.\n\t * @returns {Link}\n\t */\n\tmend()\n\t{\n\t\tsuper.set(IS_BROKEN, false);\n\t\tsuper.set(BROKEN_REASON, null);\n\t\tthis.include();\n\t\treturn this;\n\t}\n\n\n\t/**\n\t * Assign a redirected URL and change any relative state.\n\t * @param {URL|string} url\n\t * @returns {Link}\n\t */\n\tredirect(url)\n\t{\n\t\tsuper.set(REDIRECTED_URL, parseURL(url));\n\n\t\tthis.#relateWithBase();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Reassign properties associated with state relative to the link's environment.\n\t */\n\t#relateWithBase()\n\t{\n\t\tconst url = super.get(REDIRECTED_URL) ?? super.get(REBASED_URL);\n\n\t\t// If impossible to determine is linked to same server/etc\n\t\tif (url===null || super.get(RESOLVED_BASE_URL)===null)\n\t\t{\n\t\t\t// Overwrite any previous values\n\t\t\tsuper.set(IS_INTERNAL, null);\n\t\t\tsuper.set(IS_SAME_PAGE, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Rebased base URL not used because `` URL could be remote\n\t\t\t// @todo common/careful profile\n\t\t\t// @todo auth shouldn't affect this\n\t\t\tconst relation = new URLRelation(url, super.get(RESOLVED_BASE_URL));\n\n\t\t\tsuper.set(IS_INTERNAL, relation.upTo(URLRelation.HOST));\n\t\t\tsuper.set(IS_SAME_PAGE, relation.upTo(URLRelation.PATH));\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Produce and assign an absolute URL and change any relative state.\n\t * @param {URL|string|null} [url]\n\t * @param {URL|string|null} [base]\n\t * @returns {Link}\n\t */\n\tresolve(url, base)\n\t{\n\t\tif (url != null)\n\t\t{\n\t\t\t// Parse or clone\n\t\t\tbase = parseURL(base);\n\n\t\t\tif (isURL(url))\n\t\t\t{\n\t\t\t\tsuper.set(ORIGINAL_URL, url.href);\n\t\t\t\tsuper.set(RESOLVED_URL, url);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(ORIGINAL_URL, url);\n\t\t\t\tsuper.set(RESOLVED_URL, parseURL(url));\n\t\t\t}\n\n\t\t\tif (base !== null)\n\t\t\t{\n\t\t\t\t// Remove any hash since it's useless in a base -- safe to mutate\n\t\t\t\tbase.hash = \"\";\n\n\t\t\t\tconst rebased = parseURL(super.get(HTML_BASE_HREF), base);\n\n\t\t\t\tsuper.set(REBASED_BASE_URL, rebased ?? base);\n\t\t\t\tsuper.set(RESOLVED_BASE_URL, base);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(REBASED_BASE_URL, parseURL(super.get(HTML_BASE_HREF)));\n\t\t\t}\n\n\t\t\tif (super.get(REBASED_BASE_URL) !== null)\n\t\t\t{\n\t\t\t\t// Remove any hash since it's useless in a base -- safe to mutate\n\t\t\t\tsuper.get(REBASED_BASE_URL).hash = \"\";\n\n\t\t\t\tif (super.get(RESOLVED_URL) === null)\n\t\t\t\t{\n\t\t\t\t\tsuper.set(RESOLVED_URL, parseURL(url, super.get(RESOLVED_BASE_URL)));\n\t\t\t\t\tsuper.set(REBASED_URL, parseURL(url, super.get(REBASED_BASE_URL)));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuper.set(REBASED_URL, super.get(RESOLVED_URL));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(REBASED_URL, super.get(RESOLVED_URL));\n\t\t\t}\n\n\t\t\t// @todo move relation stuff out of this function -- separation of concerns?\n\t\t\tthis.#relateWithBase();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Assign a value to a supported key.\n\t * @param {symbol} key\n\t * @param {*} value\n\t * @throws {TypeError} unsupported key or undefined value\n\t * @returns {Link}\n\t */\n\tset(key, value)\n\t{\n\t\tif (!keys.includes(key))\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid key\");\n\t\t}\n\t\telse if (value === undefined)\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid value\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn super.set(key, value);\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Produce a key-value object for `JSON.stringify()`.\n\t * @returns {object}\n\t */\n\ttoJSON()\n\t{\n\t\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t\treturn Object.fromEntries(Array.from(super.entries()));\n\t}\n}\n\n\n\nconst keys =\n[\n\tBROKEN_REASON,\n\tEXCLUDED_REASON,\n\tHTML_ATTR_NAME,\n\tHTML_ATTRS,\n\tHTML_BASE_HREF,\n\tHTML_INDEX,\n\tHTML_LOCATION,\n\tHTML_OFFSET_INDEX,\n\tHTML_SELECTOR,\n\tHTML_TAG,\n\tHTML_TAG_NAME,\n\tHTML_TEXT,\n\tHTTP_RESPONSE,\n\tHTTP_RESPONSE_WAS_CACHED,\n\tIS_BROKEN,\n\tIS_INTERNAL,\n\tIS_SAME_PAGE,\n\tORIGINAL_URL,\n\tREBASED_BASE_URL,\n\tREBASED_URL,\n\tREDIRECTED_URL,\n\tRESOLVED_BASE_URL,\n\tRESOLVED_URL,\n\tWAS_EXCLUDED\n];\n\n\n\n/**\n * Parse or clone a URL.\n * @param {URL|string|null} [url]\n * @param {URL|string|null} [base]\n * @returns {URL|null}\n */\nconst parseURL = (url=null, base) =>\n{\n\tif (url !== null)\n\t{\n\t\ttry\n\t\t{\n\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;AACA;AACA;AACA;AACA;AACA,MAAMmB,QAAQ,GAAGA,CAACD,GAAG,GAAC,IAAI,EAAEtD,IAAI,KAChC;EACC,IAAIsD,GAAG,KAAK,IAAI,EAChB;IACC,IACA;MACCA,GAAG,GAAG,IAAIoB,GAAG,CAACpB,GAAG,EAAEtD,IAAI,CAAC;IACzB,CAAC,CACD,MACA;MACCsD,GAAG,GAAG,IAAI;IACX;EACD;EAEA,OAAOA,GAAG;AACX,CAAC;AAID3E,MAAM,CAACgG,MAAM,CAAClC,IAAI,CAAC"} \ No newline at end of file diff --git a/lib-cjs/internal/SafeEventEmitter.js b/lib-cjs/internal/SafeEventEmitter.js new file mode 100644 index 00000000..f842baf8 --- /dev/null +++ b/lib-cjs/internal/SafeEventEmitter.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _events = require("../internal/events"); +var _events2 = require("events"); +class SafeEventEmitter extends _events2.EventEmitter { + /** + * Emit an event while catching any errors within consumer handlers. + * @param {string} type + * @param {...*} args + */ + emit(type, ...args) { + try { + super.emit(type, ...args); + } catch (error) { + super.emit(_events.ERROR_EVENT, error); + } + } +} +exports.default = SafeEventEmitter; +module.exports = exports.default; +//# sourceMappingURL=SafeEventEmitter.js.map \ No newline at end of file diff --git a/lib-cjs/internal/SafeEventEmitter.js.map b/lib-cjs/internal/SafeEventEmitter.js.map new file mode 100644 index 00000000..1eb4984f --- /dev/null +++ b/lib-cjs/internal/SafeEventEmitter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SafeEventEmitter.js","names":["_events","require","_events2","SafeEventEmitter","EventEmitter","emit","type","args","error","ERROR_EVENT","exports","default","module"],"sources":["../../lib/internal/SafeEventEmitter.js"],"sourcesContent":["import {ERROR_EVENT} from \"../internal/events\";\nimport {EventEmitter} from \"events\";\n\n\n\nexport default class SafeEventEmitter extends EventEmitter\n{\n\t/**\n\t * Emit an event while catching any errors within consumer handlers.\n\t * @param {string} type\n\t * @param {...*} args\n\t */\n\temit(type, ...args)\n\t{\n\t\ttry\n\t\t{\n\t\t\tsuper.emit(type, ...args);\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\tsuper.emit(ERROR_EVENT, error);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIe,MAAME,gBAAgB,SAASC,qBAAY,CAC1D;EACC;AACD;AACA;AACA;AACA;EACCC,IAAIA,CAACC,IAAI,EAAE,GAAGC,IAAI,EAClB;IACC,IACA;MACC,KAAK,CAACF,IAAI,CAACC,IAAI,EAAE,GAAGC,IAAI,CAAC;IAC1B,CAAC,CACD,OAAOC,KAAK,EACZ;MACC,KAAK,CAACH,IAAI,CAACI,mBAAW,EAAED,KAAK,CAAC;IAC/B;EACD;AACD;AAACE,OAAA,CAAAC,OAAA,GAAAR,gBAAA;AAAAS,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/checkLink.js b/lib-cjs/internal/checkLink.js new file mode 100644 index 00000000..43e66018 --- /dev/null +++ b/lib-cjs/internal/checkLink.js @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var reasons = _interopRequireWildcard(require("./reasons")); +var _fileProtocol = require("./file-protocol"); +var _httpProtocol = require("./http-protocol"); +var _isString = _interopRequireDefault(require("is-string")); +var _Link = _interopRequireWildcard(require("./Link")); +var _matchURL = _interopRequireDefault(require("./matchURL")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +/** + * Check a link's URL to see if it is broken or not. + * @param {Link} link + * @param {object} auth + * @param {URLCache} cache + * @param {object} options + * @throws {TypeError} non-Link + * @returns {Promise} + */ +var _default = async (link, auth, cache, options) => { + if (!(link instanceof _Link.default)) { + throw new TypeError("Invalid Link"); + } else { + const { + excludedKeywords, + includedKeywords, + includeLink + } = options; + const rebasedURL = link.get(_Link.REBASED_URL); + if (rebasedURL === null) { + link.break("BLC_INVALID"); + return link; + } else if (!(0, _fileProtocol.isCompatibleScheme)(rebasedURL) && !(0, _httpProtocol.isCompatibleScheme)(rebasedURL)) { + link.exclude("BLC_UNSUPPORTED"); + return link; + } else if ((0, _matchURL.default)(rebasedURL.href, excludedKeywords)) { + link.exclude("BLC_KEYWORD"); + return link; + } else if (includedKeywords.length > 0 && !(0, _matchURL.default)(rebasedURL.href, includedKeywords)) { + link.exclude("BLC_KEYWORD"); + return link; + } else { + const filterResult = includeLink(link); + + // Undocumented support for strings (from `SiteChecker`) + if ((0, _isString.default)(filterResult) && filterResult in reasons) { + link.exclude(filterResult); + return link; + } else if (!filterResult) { + link.exclude("BLC_CUSTOM"); + return link; + } else { + if ((0, _fileProtocol.isCompatibleScheme)(rebasedURL)) { + return (0, _fileProtocol.checkLink)(link); + } else if ((0, _httpProtocol.isCompatibleScheme)(rebasedURL)) { + return (0, _httpProtocol.checkLink)(link, auth, cache, options); + } + } + } + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkLink.js.map \ No newline at end of file diff --git a/lib-cjs/internal/checkLink.js.map b/lib-cjs/internal/checkLink.js.map new file mode 100644 index 00000000..ad252250 --- /dev/null +++ b/lib-cjs/internal/checkLink.js.map @@ -0,0 +1 @@ +{"version":3,"file":"checkLink.js","names":["reasons","_interopRequireWildcard","require","_fileProtocol","_httpProtocol","_isString","_interopRequireDefault","_Link","_matchURL","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_default","link","auth","cache","options","Link","TypeError","excludedKeywords","includedKeywords","includeLink","rebasedURL","REBASED_URL","break","isFileScheme","isHTTPScheme","exclude","matchURL","href","length","filterResult","isString","checkFileLink","checkHTTPLink","exports","module"],"sources":["../../lib/internal/checkLink.js"],"sourcesContent":["import * as reasons from \"./reasons\";\nimport {checkLink as checkFileLink, isCompatibleScheme as isFileScheme} from \"./file-protocol\";\nimport {checkLink as checkHTTPLink, isCompatibleScheme as isHTTPScheme} from \"./http-protocol\";\nimport isString from \"is-string\";\nimport Link, {REBASED_URL} from \"./Link\";\nimport matchURL from \"./matchURL\";\n\n\n\n/**\n * Check a link's URL to see if it is broken or not.\n * @param {Link} link\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-Link\n * @returns {Promise}\n */\nexport default async (link, auth, cache, options) =>\n{\n\tif (!(link instanceof Link))\n\t{\n\t\tthrow new TypeError(\"Invalid Link\");\n\t}\n\telse\n\t{\n\t\tconst {excludedKeywords, includedKeywords, includeLink} = options;\n\t\tconst rebasedURL = link.get(REBASED_URL);\n\n\t\tif (rebasedURL === null)\n\t\t{\n\t\t\tlink.break(\"BLC_INVALID\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (!isFileScheme(rebasedURL) && !isHTTPScheme(rebasedURL))\n\t\t{\n\t\t\tlink.exclude(\"BLC_UNSUPPORTED\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (matchURL(rebasedURL.href, excludedKeywords))\n\t\t{\n\t\t\tlink.exclude(\"BLC_KEYWORD\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (includedKeywords.length>0 && !matchURL(rebasedURL.href, includedKeywords))\n\t\t{\n\t\t\tlink.exclude(\"BLC_KEYWORD\");\n\t\t\treturn link;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst filterResult = includeLink(link);\n\n\t\t\t// Undocumented support for strings (from `SiteChecker`)\n\t\t\tif (isString(filterResult) && filterResult in reasons)\n\t\t\t{\n\t\t\t\tlink.exclude(filterResult);\n\t\t\t\treturn link;\n\t\t\t}\n\t\t\telse if (!filterResult)\n\t\t\t{\n\t\t\t\tlink.exclude(\"BLC_CUSTOM\");\n\t\t\t\treturn link;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (isFileScheme(rebasedURL))\n\t\t\t\t{\n\t\t\t\t\treturn checkFileLink(link);\n\t\t\t\t}\n\t\t\t\telse if (isHTTPScheme(rebasedURL))\n\t\t\t\t{\n\t\t\t\t\treturn checkHTTPLink(link, auth, cache, options);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAAkC,SAAAI,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAE,CAAA,S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AC;QACjD;MACD;IACD;EACD;AACD,CAAC;AAAAmB,OAAA,CAAA3C,OAAA,GAAAoB,QAAA;AAAAwB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3C,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/defaultOptions.js b/lib-cjs/internal/defaultOptions.js new file mode 100644 index 00000000..998ccb15 --- /dev/null +++ b/lib-cjs/internal/defaultOptions.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _deepFreezeNode = _interopRequireDefault(require("deep-freeze-node")); +var _httpMethodsConstants = require("http-methods-constants"); +var _package = require("../../package.json"); +var _tags = _interopRequireDefault(require("./tags")); +var _defaultUserAgent = _interopRequireDefault(require("default-user-agent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = exports.default = (0, _deepFreezeNode.default)({ + cacheMaxAge: 3_600_000, + cacheResponses: true, + excludedKeywords: [], + excludeExternalLinks: false, + excludeInternalLinks: false, + excludeLinksToSamePage: false, + filterLevel: 1, + honorRobotExclusions: true, + includedKeywords: [], + includeLink: () => true, + includePage: () => true, + maxSockets: Infinity, + // @todo change to `maxExternalSockets` + maxSocketsPerHost: 1, + // @todo separate to `maxInternalSockets=5` and `maxExternalSocketsPerHost=1` + rateLimit: 0, + requestMethod: _httpMethodsConstants.HEAD, + retryHeadCodes: [405], + retryHeadFail: true, + tags: _tags.default, + userAgent: (0, _defaultUserAgent.default)(_package.name, _package.version) +}); +module.exports = exports.default; +//# sourceMappingURL=defaultOptions.js.map \ No newline at end of file diff --git a/lib-cjs/internal/defaultOptions.js.map b/lib-cjs/internal/defaultOptions.js.map new file mode 100644 index 00000000..35c1f47e --- /dev/null +++ b/lib-cjs/internal/defaultOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defaultOptions.js","names":["_deepFreezeNode","_interopRequireDefault","require","_httpMethodsConstants","_package","_tags","_defaultUserAgent","obj","__esModule","default","_default","exports","deepFreeze","cacheMaxAge","cacheResponses","excludedKeywords","excludeExternalLinks","excludeInternalLinks","excludeLinksToSamePage","filterLevel","honorRobotExclusions","includedKeywords","includeLink","includePage","maxSockets","Infinity","maxSocketsPerHost","rateLimit","requestMethod","HEAD","retryHeadCodes","retryHeadFail","tags","TAGS","userAgent","packageName","packageVersion","module"],"sources":["../../lib/internal/defaultOptions.js"],"sourcesContent":["import deepFreeze from \"deep-freeze-node\";\nimport {HEAD} from \"http-methods-constants\";\nimport {name as packageName, version as packageVersion} from \"../../package.json\";\nimport TAGS from \"./tags\";\nimport userAgent from \"default-user-agent\";\n\n\n\nexport default deepFreeze(\n{\n\tcacheMaxAge: 3_600_000,\n\tcacheResponses: true,\n\texcludedKeywords: [],\n\texcludeExternalLinks: false,\n\texcludeInternalLinks: false,\n\texcludeLinksToSamePage: false,\n\tfilterLevel: 1,\n\thonorRobotExclusions: true,\n\tincludedKeywords: [],\n\tincludeLink: () => true,\n\tincludePage: () => true,\n\tmaxSockets: Infinity, // @todo change to `maxExternalSockets`\n\tmaxSocketsPerHost: 1, // @todo separate to `maxInternalSockets=5` and `maxExternalSocketsPerHost=1`\n\trateLimit: 0,\n\trequestMethod: HEAD,\n\tretryHeadCodes: [405],\n\tretryHeadFail: true,\n\ttags: TAGS,\n\tuserAgent: userAgent(packageName, packageVersion)\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAI5B,IAAAG,uBAAU,EACzB;EACCC,WAAW,EAAE,SAAS;EACtBC,cAAc,EAAE,IAAI;EACpBC,gBAAgB,EAAE,EAAE;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,oBAAoB,EAAE,KAAK;EAC3BC,sBAAsB,EAAE,KAAK;EAC7BC,WAAW,EAAE,CAAC;EACdC,oBAAoB,EAAE,IAAI;EAC1BC,gBAAgB,EAAE,EAAE;EACpBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,UAAU,EAAEC,QAAQ;EAAG;EACvBC,iBAAiB,EAAE,CAAC;EAAG;EACvBC,SAAS,EAAE,CAAC;EACZC,aAAa,EAAEC,0BAAI;EACnBC,cAAc,EAAE,CAAC,GAAG,CAAC;EACrBC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,aAAI;EACVC,SAAS,EAAE,IAAAA,yBAAS,EAACC,aAAW,EAAEC,gBAAc;AACjD,CAAC,CAAC;AAAAC,MAAA,CAAA1B,OAAA,GAAAA,OAAA,CAAAF,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/errors.js b/lib-cjs/internal/errors.js new file mode 100644 index 00000000..ad227a31 --- /dev/null +++ b/lib-cjs/internal/errors.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ExpectedHTMLExtensionError", { + enumerable: true, + get: function () { + return _fileProtocol.ExpectedHTMLExtensionError; + } +}); +Object.defineProperty(exports, "ExpectedHTMLMediaTypeError", { + enumerable: true, + get: function () { + return _httpProtocol.ExpectedHTMLMediaTypeError; + } +}); +exports.HTMLRetrievalError = void 0; +var _fileProtocol = require("./file-protocol"); +var _httpProtocol = require("./http-protocol"); +class HTMLRetrievalError extends Error { + /** + * @param {number|string} statusCode + */ + constructor(statusCode) { + super("HTML could not be retrieved"); + this.code = statusCode; + } +} +exports.HTMLRetrievalError = HTMLRetrievalError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/lib-cjs/internal/errors.js.map b/lib-cjs/internal/errors.js.map new file mode 100644 index 00000000..f4e7c840 --- /dev/null +++ b/lib-cjs/internal/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","names":["_fileProtocol","require","_httpProtocol","HTMLRetrievalError","Error","constructor","statusCode","code","exports"],"sources":["../../lib/internal/errors.js"],"sourcesContent":["export {ExpectedHTMLExtensionError} from \"./file-protocol\";\nexport {ExpectedHTMLMediaTypeError} from \"./http-protocol\";\n\nexport class HTMLRetrievalError extends Error\n{\n\t/**\n\t * @param {number|string} statusCode\n\t */\n\tconstructor(statusCode)\n\t{\n\t\tsuper(\"HTML could not be retrieved\");\n\t\tthis.code = statusCode;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,SAASC,KAAK,CAC7C;EACC;AACD;AACA;EACCC,WAAWA,CAACC,UAAU,EACtB;IACC,KAAK,CAAC,6BAA6B,CAAC;IACpC,IAAI,CAACC,IAAI,GAAGD,UAAU;EACvB;AACD;AAACE,OAAA,CAAAL,kBAAA,GAAAA,kBAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/events.js b/lib-cjs/internal/events.js new file mode 100644 index 00000000..a698ed0f --- /dev/null +++ b/lib-cjs/internal/events.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SITE_EVENT = exports.ROBOTS_EVENT = exports.QUEUE_EVENT = exports.PAGE_EVENT = exports.LINK_EVENT = exports.JUNK_EVENT = exports.HTML_EVENT = exports.ERROR_EVENT = exports.END_EVENT = exports.COMPLETE_EVENT = void 0; +const COMPLETE_EVENT = exports.COMPLETE_EVENT = "complete"; +const END_EVENT = exports.END_EVENT = "end"; +const ERROR_EVENT = exports.ERROR_EVENT = "error"; +const HTML_EVENT = exports.HTML_EVENT = "html"; +const JUNK_EVENT = exports.JUNK_EVENT = "junk"; +const LINK_EVENT = exports.LINK_EVENT = "link"; +const PAGE_EVENT = exports.PAGE_EVENT = "page"; +const QUEUE_EVENT = exports.QUEUE_EVENT = "queue"; +const ROBOTS_EVENT = exports.ROBOTS_EVENT = "robots"; +const SITE_EVENT = exports.SITE_EVENT = "site"; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/lib-cjs/internal/events.js.map b/lib-cjs/internal/events.js.map new file mode 100644 index 00000000..8645fa47 --- /dev/null +++ b/lib-cjs/internal/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","names":["COMPLETE_EVENT","exports","END_EVENT","ERROR_EVENT","HTML_EVENT","JUNK_EVENT","LINK_EVENT","PAGE_EVENT","QUEUE_EVENT","ROBOTS_EVENT","SITE_EVENT"],"sources":["../../lib/internal/events.js"],"sourcesContent":["export const COMPLETE_EVENT = \"complete\";\nexport const END_EVENT = \"end\";\nexport const ERROR_EVENT = \"error\";\nexport const HTML_EVENT = \"html\";\nexport const JUNK_EVENT = \"junk\";\nexport const LINK_EVENT = \"link\";\nexport const PAGE_EVENT = \"page\";\nexport const QUEUE_EVENT = \"queue\";\nexport const ROBOTS_EVENT = \"robots\";\nexport const SITE_EVENT = \"site\";\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,UAAU;AACjC,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,KAAK;AACvB,MAAMC,WAAW,GAAAF,OAAA,CAAAE,WAAA,GAAG,OAAO;AAC3B,MAAMC,UAAU,GAAAH,OAAA,CAAAG,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAN,OAAA,CAAAM,UAAA,GAAG,MAAM;AACzB,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG,OAAO;AAC3B,MAAMC,YAAY,GAAAR,OAAA,CAAAQ,YAAA,GAAG,QAAQ;AAC7B,MAAMC,UAAU,GAAAT,OAAA,CAAAS,UAAA,GAAG,MAAM"} \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/checkLink.js b/lib-cjs/internal/file-protocol/checkLink.js new file mode 100644 index 00000000..f2b70f39 --- /dev/null +++ b/lib-cjs/internal/file-protocol/checkLink.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _Link = require("../Link"); +var _promises = require("fs/promises"); +/** + * Check a link on the local file system. + * @param {Link} link + * @returns {Promise} + */ +var _default = async link => { + try { + const { + isDirectory + } = await (0, _promises.stat)(link.get(_Link.REBASED_URL).pathname); + if (isDirectory()) { + link.exclude("BLC_DIRECTORY"); + } else { + link.mend(); + } + } + // @todo possible that a `Link` method could fail; then set BLC_UNKNOWN ? + catch ({ + code + }) { + link.break(`ERRNO_${code}`); + } + return link; +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkLink.js.map \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/checkLink.js.map b/lib-cjs/internal/file-protocol/checkLink.js.map new file mode 100644 index 00000000..5c6aa21f --- /dev/null +++ b/lib-cjs/internal/file-protocol/checkLink.js.map @@ -0,0 +1 @@ +{"version":3,"file":"checkLink.js","names":["_Link","require","_promises","_default","link","isDirectory","statFile","get","REBASED_URL","pathname","exclude","mend","code","break","exports","default","module"],"sources":["../../../lib/internal/file-protocol/checkLink.js"],"sourcesContent":["import {REBASED_URL} from \"../Link\";\nimport {stat as statFile} from \"fs/promises\";\n\n\n\n/**\n * Check a link on the local file system.\n * @param {Link} link\n * @returns {Promise}\n */\nexport default async link =>\n{\n\ttry\n\t{\n\t\tconst {isDirectory} = await statFile(link.get(REBASED_URL).pathname);\n\n\t\tif (isDirectory())\n\t\t{\n\t\t\tlink.exclude(\"BLC_DIRECTORY\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlink.mend();\n\t\t}\n\t}\n\t// @todo possible that a `Link` method could fail; then set BLC_UNKNOWN ?\n\tcatch ({code})\n\t{\n\t\tlink.break(`ERRNO_${code}`);\n\t}\n\n\treturn link;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA;AACA;AACA;AACA;AACA;AAJA,IAAAE,QAAA,GAKe,MAAMC,IAAI,IACzB;EACC,IACA;IACC,MAAM;MAACC;IAAW,CAAC,GAAG,MAAM,IAAAC,cAAQ,EAACF,IAAI,CAACG,GAAG,CAACC,iBAAW,CAAC,CAACC,QAAQ,CAAC;IAEpE,IAAIJ,WAAW,CAAC,CAAC,EACjB;MACCD,IAAI,CAACM,OAAO,CAAC,eAAe,CAAC;IAC9B,CAAC,MAED;MACCN,IAAI,CAACO,IAAI,CAAC,CAAC;IACZ;EACD;EACA;EACA,OAAO;IAACC;EAAI,CAAC,EACb;IACCR,IAAI,CAACS,KAAK,CAAE,SAAQD,IAAK,EAAC,CAAC;EAC5B;EAEA,OAAOR,IAAI;AACZ,CAAC;AAAAU,OAAA,CAAAC,OAAA,GAAAZ,QAAA;AAAAa,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/errors.js b/lib-cjs/internal/file-protocol/errors.js new file mode 100644 index 00000000..c507dcad --- /dev/null +++ b/lib-cjs/internal/file-protocol/errors.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ExpectedHTMLExtensionError = void 0; +class ExpectedHTMLExtensionError extends TypeError { + /** + * @param {string} extension + */ + constructor(extension = "") { + if (extension !== "") { + extension = ` but got "${extension}"`; + } + super(`Expected a compatible HTML file extension$"{extension}`); + } +} +exports.ExpectedHTMLExtensionError = ExpectedHTMLExtensionError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/errors.js.map b/lib-cjs/internal/file-protocol/errors.js.map new file mode 100644 index 00000000..1fd2ecf1 --- /dev/null +++ b/lib-cjs/internal/file-protocol/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","names":["ExpectedHTMLExtensionError","TypeError","constructor","extension","exports"],"sources":["../../../lib/internal/file-protocol/errors.js"],"sourcesContent":["export class ExpectedHTMLExtensionError extends TypeError\n{\n\t/**\n\t * @param {string} extension\n\t */\n\tconstructor(extension = \"\")\n\t{\n\t\tif (extension !== \"\")\n\t\t{\n\t\t\textension = ` but got \"${extension}\"`;\n\t\t}\n\n\t\tsuper(`Expected a compatible HTML file extension$\"{extension}`);\n\t}\n}\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,SAASC,SAAS,CACzD;EACC;AACD;AACA;EACCC,WAAWA,CAACC,SAAS,GAAG,EAAE,EAC1B;IACC,IAAIA,SAAS,KAAK,EAAE,EACpB;MACCA,SAAS,GAAI,aAAYA,SAAU,GAAE;IACtC;IAEA,KAAK,CAAE,wDAAuD,CAAC;EAChE;AACD;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/index.js b/lib-cjs/internal/file-protocol/index.js new file mode 100644 index 00000000..8f5f0229 --- /dev/null +++ b/lib-cjs/internal/file-protocol/index.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ExpectedHTMLExtensionError", { + enumerable: true, + get: function () { + return _errors.ExpectedHTMLExtensionError; + } +}); +Object.defineProperty(exports, "checkLink", { + enumerable: true, + get: function () { + return _checkLink.default; + } +}); +Object.defineProperty(exports, "isCompatibleScheme", { + enumerable: true, + get: function () { + return _isCompatibleScheme.default; + } +}); +Object.defineProperty(exports, "streamHTML", { + enumerable: true, + get: function () { + return _streamHTML.default; + } +}); +var _checkLink = _interopRequireDefault(require("./checkLink")); +var _isCompatibleScheme = _interopRequireDefault(require("./isCompatibleScheme")); +var _streamHTML = _interopRequireDefault(require("./streamHTML")); +var _errors = require("./errors"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/index.js.map b/lib-cjs/internal/file-protocol/index.js.map new file mode 100644 index 00000000..82ad5ed7 --- /dev/null +++ b/lib-cjs/internal/file-protocol/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_checkLink","_interopRequireDefault","require","_isCompatibleScheme","_streamHTML","_errors","obj","__esModule","default"],"sources":["../../../lib/internal/file-protocol/index.js"],"sourcesContent":["// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as checkLink} from \"./checkLink\";\nexport {default as isCompatibleScheme} from \"./isCompatibleScheme\";\nexport {default as streamHTML} from \"./streamHTML\";\n\nexport {ExpectedHTMLExtensionError} from \"./errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAAoD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/isCompatibleScheme.js b/lib-cjs/internal/file-protocol/isCompatibleScheme.js new file mode 100644 index 00000000..b72c2fdd --- /dev/null +++ b/lib-cjs/internal/file-protocol/isCompatibleScheme.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +/** + * Determine whether a URL supports a file scheme/protocol. + * @param {URL} url + * @returns {boolean} + */ +var _default = url => url.protocol === "file:"; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=isCompatibleScheme.js.map \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map b/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map new file mode 100644 index 00000000..7a059c92 --- /dev/null +++ b/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isCompatibleScheme.js","names":["_default","url","protocol","exports","default","module"],"sources":["../../../lib/internal/file-protocol/isCompatibleScheme.js"],"sourcesContent":["/**\n * Determine whether a URL supports a file scheme/protocol.\n * @param {URL} url\n * @returns {boolean}\n */\nexport default url => url.protocol === \"file:\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAAAA,QAAA,GAKeC,GAAG,IAAIA,GAAG,CAACC,QAAQ,KAAK,OAAO;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA;AAAAK,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/streamHTML.js b/lib-cjs/internal/file-protocol/streamHTML.js new file mode 100644 index 00000000..8d528881 --- /dev/null +++ b/lib-cjs/internal/file-protocol/streamHTML.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _fs = require("fs"); +var _errors = require("./errors"); +var _path = require("path"); +var _errors2 = require("../errors"); +const FILE_EXTENSIONS = [".htm", ".html", ".xht", ".xhtml"]; +const ERROR_EVENT = "error"; +const OPEN_EVENT = "open"; + +/** + * Read a file URL for its HTML contents. + * @param {URL} url + * @throws {ExpectedHTMLExtensionError} if not HTML media type + * @throws {HTMLRetrievalError} file not found, etc + * @returns {Promise} + * @todo return {response, stream} structure to be consistent with HTTP, and thereby support other protocols? + */ +var _default = url => new Promise((resolve, reject) => { + const pathFileExtension = (0, _path.extname)(url.pathname); + if (!FILE_EXTENSIONS.some(ext => pathFileExtension === ext)) { + throw new _errors.ExpectedHTMLExtensionError(pathFileExtension); + } else { + const stream = (0, _fs.createReadStream)(url); + stream.on(ERROR_EVENT, ({ + code + }) => reject(new _errors2.HTMLRetrievalError(code))); + stream.on(OPEN_EVENT, () => resolve(stream)); + } +}); +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=streamHTML.js.map \ No newline at end of file diff --git a/lib-cjs/internal/file-protocol/streamHTML.js.map b/lib-cjs/internal/file-protocol/streamHTML.js.map new file mode 100644 index 00000000..0929cc68 --- /dev/null +++ b/lib-cjs/internal/file-protocol/streamHTML.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamHTML.js","names":["_fs","require","_errors","_path","_errors2","FILE_EXTENSIONS","ERROR_EVENT","OPEN_EVENT","_default","url","Promise","resolve","reject","pathFileExtension","extname","pathname","some","ext","ExpectedHTMLExtensionError","stream","createReadStream","on","code","HTMLRetrievalError","exports","default","module"],"sources":["../../../lib/internal/file-protocol/streamHTML.js"],"sourcesContent":["import {createReadStream} from \"fs\";\nimport {ExpectedHTMLExtensionError} from \"./errors\";\nimport {extname} from \"path\";\nimport {HTMLRetrievalError} from \"../errors\";\n\n\n\nconst FILE_EXTENSIONS = [\".htm\", \".html\", \".xht\", \".xhtml\"];\n\nconst ERROR_EVENT = \"error\";\nconst OPEN_EVENT = \"open\";\n\n\n\n/**\n * Read a file URL for its HTML contents.\n * @param {URL} url\n * @throws {ExpectedHTMLExtensionError} if not HTML media type\n * @throws {HTMLRetrievalError} file not found, etc\n * @returns {Promise}\n * @todo return {response, stream} structure to be consistent with HTTP, and thereby support other protocols?\n */\nexport default url => new Promise((resolve, reject) =>\n{\n\tconst pathFileExtension = extname(url.pathname);\n\n\tif (!FILE_EXTENSIONS.some(ext => pathFileExtension === ext))\n\t{\n\t\tthrow new ExpectedHTMLExtensionError(pathFileExtension);\n\t}\n\telse\n\t{\n\t\tconst stream = createReadStream(url);\n\n\t\tstream.on(ERROR_EVENT, ({code}) => reject(new HTMLRetrievalError(code)));\n\t\tstream.on(OPEN_EVENT, () => resolve(stream));\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAIA,MAAMI,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC;AAE3D,MAAMC,WAAW,GAAG,OAAO;AAC3B,MAAMC,UAAU,GAAG,MAAM;;AAIzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAQeC,GAAG,IAAI,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAClD;EACC,MAAMC,iBAAiB,GAAG,IAAAC,aAAO,EAACL,GAAG,CAACM,QAAQ,CAAC;EAE/C,IAAI,CAACV,eAAe,CAACW,IAAI,CAACC,GAAG,IAAIJ,iBAAiB,KAAKI,GAAG,CAAC,EAC3D;IACC,MAAM,IAAIC,kCAA0B,CAACL,iBAAiB,CAAC;EACxD,CAAC,MAED;IACC,MAAMM,MAAM,GAAG,IAAAC,oBAAgB,EAACX,GAAG,CAAC;IAEpCU,MAAM,CAACE,EAAE,CAACf,WAAW,EAAE,CAAC;MAACgB;IAAI,CAAC,KAAKV,MAAM,CAAC,IAAIW,2BAAkB,CAACD,IAAI,CAAC,CAAC,CAAC;IACxEH,MAAM,CAACE,EAAE,CAACd,UAAU,EAAE,MAAMI,OAAO,CAACQ,MAAM,CAAC,CAAC;EAC7C;AACD,CAAC,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAjB,QAAA;AAAAkB,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/checkLink.js b/lib-cjs/internal/http-protocol/checkLink.js new file mode 100644 index 00000000..7f4c2348 --- /dev/null +++ b/lib-cjs/internal/http-protocol/checkLink.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _lodash = require("lodash"); +var _Link = require("../Link"); +var _request = _interopRequireDefault(require("./request")); +var _urlRelation = _interopRequireDefault(require("url-relation")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * Copy data from a cached or uncached response into a Link. + * @param {object|Error} response + * @param {Link} link + * @param {object} options + */ +const copyResponseData = (response, link, { + cacheResponses +}) => { + const { + code, + status, + url + } = response; + if (response instanceof Error) { + link.break(`ERRNO_${code}`); + } else { + if (status < 200 || status > 299) { + link.break(`HTTP_${status}`); + } else { + link.mend(); + } + + // @todo would a string check be sufficient? + if (!_urlRelation.default.match(url, link.get(_Link.REBASED_URL), { + targetComponent: _urlRelation.default.PATH + })) { + // @todo this needs a test + // @todo test if redirected to a different protocol + link.redirect(url); + } + if (cacheResponses) { + // Avoid potential mutations to cache + response = (0, _lodash.cloneDeep)(response); + } + link.set(_Link.HTTP_RESPONSE, response); + } +}; + +/** + * Check a link's URL to see if it is broken or not. + * @param {Link} link + * @param {object} auth + * @param {URLCache} cache + * @param {object} options + * @throws {TypeError} non-Link + * @returns {Promise} + */ +var _default = async (link, auth, cache, options) => { + const { + cacheResponses, + requestMethod + } = options; + if (cacheResponses) { + const result = cache.get(link.get(_Link.REBASED_URL)); + if (result !== undefined) { + copyResponseData(await result, link, options); + link.set(_Link.HTTP_RESPONSE_WAS_CACHED, true); + } + } + if (link.get(_Link.HTTP_RESPONSE_WAS_CACHED) === null) { + const result = await (0, _request.default)(link.get(_Link.REBASED_URL), auth, requestMethod, cache, options).then(({ + response + }) => response) // exclude any stream + .catch(error => error); + copyResponseData(result, link, options); + link.set(_Link.HTTP_RESPONSE_WAS_CACHED, false); + } + return link; +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkLink.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/checkLink.js.map b/lib-cjs/internal/http-protocol/checkLink.js.map new file mode 100644 index 00000000..69bdb4bd --- /dev/null +++ b/lib-cjs/internal/http-protocol/checkLink.js.map @@ -0,0 +1 @@ +{"version":3,"file":"checkLink.js","names":["_lodash","require","_Link","_request","_interopRequireDefault","_urlRelation","obj","__esModule","default","copyResponseData","response","link","cacheResponses","code","status","url","Error","break","mend","URLRelation","match","get","REBASED_URL","targetComponent","PATH","redirect","cloneDeep","set","HTTP_RESPONSE","_default","auth","cache","options","requestMethod","result","undefined","HTTP_RESPONSE_WAS_CACHED","request","then","catch","error","exports","module"],"sources":["../../../lib/internal/http-protocol/checkLink.js"],"sourcesContent":["import {cloneDeep} from \"lodash\";\nimport {HTTP_RESPONSE, HTTP_RESPONSE_WAS_CACHED, REBASED_URL} from \"../Link\";\nimport request from \"./request\";\nimport URLRelation from \"url-relation\";\n\n\n\n/**\n * Copy data from a cached or uncached response into a Link.\n * @param {object|Error} response\n * @param {Link} link\n * @param {object} options\n */\nconst copyResponseData = (response, link, {cacheResponses}) =>\n{\n\tconst {code, status, url} = response;\n\n\tif (response instanceof Error)\n\t{\n\t\tlink.break(`ERRNO_${code}`);\n\t}\n\telse\n\t{\n\t\tif (status<200 || status>299)\n\t\t{\n\t\t\tlink.break(`HTTP_${status}`);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlink.mend();\n\t\t}\n\n\t\t// @todo would a string check be sufficient?\n\t\tif (!URLRelation.match(url, link.get(REBASED_URL), { targetComponent:URLRelation.PATH }))\n\t\t{\n\t\t\t// @todo this needs a test\n\t\t\t// @todo test if redirected to a different protocol\n\t\t\tlink.redirect(url);\n\t\t}\n\n\t\tif (cacheResponses)\n\t\t{\n\t\t\t// Avoid potential mutations to cache\n\t\t\tresponse = cloneDeep(response);\n\t\t}\n\n\t\tlink.set(HTTP_RESPONSE, response);\n\t}\n};\n\n\n\n/**\n * Check a link's URL to see if it is broken or not.\n * @param {Link} link\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-Link\n * @returns {Promise}\n */\nexport default async (link, auth, cache, options) =>\n{\n\tconst {cacheResponses, requestMethod} = options;\n\n\tif (cacheResponses)\n\t{\n\t\tconst result = cache.get(link.get(REBASED_URL));\n\n\t\tif (result !== undefined)\n\t\t{\n\t\t\tcopyResponseData(await result, link, options);\n\n\t\t\tlink.set(HTTP_RESPONSE_WAS_CACHED, true);\n\t\t}\n\t}\n\n\tif (link.get(HTTP_RESPONSE_WAS_CACHED) === null)\n\t{\n\t\tconst result = await request(link.get(REBASED_URL), auth, requestMethod, cache, options)\n\t\t.then(({response}) => response) // exclude any stream\n\t\t.catch(error => error);\n\n\t\tcopyResponseData(result, link, options);\n\n\t\tlink.set(HTTP_RESPONSE_WAS_CACHED, false);\n\t}\n\n\treturn link;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAuC,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIvC;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CAACC,QAAQ,EAAEC,IAAI,EAAE;EAACC;AAAc,CAAC,KAC1D;EACC,MAAM;IAACC,IAAI;IAAEC,MAAM;IAAEC;EAAG,CAAC,GAAGL,QAAQ;EAEpC,IAAIA,QAAQ,YAAYM,KAAK,EAC7B;IACCL,IAAI,CAACM,KAAK,CAAE,SAAQJ,IAAK,EAAC,CAAC;EAC5B,CAAC,MAED;IACC,IAAIC,MAAM,GAAC,GAAG,IAAIA,MAAM,GAAC,GAAG,EAC5B;MACCH,IAAI,CAACM,KAAK,CAAE,QAAOH,MAAO,EAAC,CAAC;IAC7B,CAAC,MAED;MACC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,CAChC6B,KAAK,CAACC,KAAK,IAAIA,KAAK,CAAC;IAEtB/B,gBAAgB,CAACyB,MAAM,EAAEvB,IAAI,EAAEqB,OAAO,CAAC;IAEvCrB,IAAI,CAACgB,GAAG,CAACS,8BAAwB,EAAE,KAAK,CAAC;EAC1C;EAEA,OAAOzB,IAAI;AACZ,CAAC;AAAA8B,OAAA,CAAAjC,OAAA,GAAAqB,QAAA;AAAAa,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/errors.js b/lib-cjs/internal/http-protocol/errors.js new file mode 100644 index 00000000..a8c9b2a6 --- /dev/null +++ b/lib-cjs/internal/http-protocol/errors.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ExpectedHTMLMediaTypeError = void 0; +class ExpectedHTMLMediaTypeError extends TypeError { + /** + * @param {string} mediaType + * @param {number|string} statusCode + */ + constructor(mediaType = "", statusCode) { + if (mediaType !== "") { + mediaType = ` but got "${mediaType}"`; + } + super(`Expected a compatible (X)HTML media type$"{mediaType}`); + this.code = statusCode; + } +} +exports.ExpectedHTMLMediaTypeError = ExpectedHTMLMediaTypeError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/errors.js.map b/lib-cjs/internal/http-protocol/errors.js.map new file mode 100644 index 00000000..fe9c1676 --- /dev/null +++ b/lib-cjs/internal/http-protocol/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","names":["ExpectedHTMLMediaTypeError","TypeError","constructor","mediaType","statusCode","code","exports"],"sources":["../../../lib/internal/http-protocol/errors.js"],"sourcesContent":["export class ExpectedHTMLMediaTypeError extends TypeError\n{\n\t/**\n\t * @param {string} mediaType\n\t * @param {number|string} statusCode\n\t */\n\tconstructor(mediaType=\"\", statusCode)\n\t{\n\t\tif (mediaType !== \"\")\n\t\t{\n\t\t\tmediaType = ` but got \"${mediaType}\"`;\n\t\t}\n\n\t\tsuper(`Expected a compatible (X)HTML media type$\"{mediaType}`);\n\t\tthis.code = statusCode;\n\t}\n}\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,SAASC,SAAS,CACzD;EACC;AACD;AACA;AACA;EACCC,WAAWA,CAACC,SAAS,GAAC,EAAE,EAAEC,UAAU,EACpC;IACC,IAAID,SAAS,KAAK,EAAE,EACpB;MACCA,SAAS,GAAI,aAAYA,SAAU,GAAE;IACtC;IAEA,KAAK,CAAE,uDAAsD,CAAC;IAC9D,IAAI,CAACE,IAAI,GAAGD,UAAU;EACvB;AACD;AAACE,OAAA,CAAAN,0BAAA,GAAAA,0BAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/getRobotsTxt.js b/lib-cjs/internal/http-protocol/getRobotsTxt.js new file mode 100644 index 00000000..75c4e33c --- /dev/null +++ b/lib-cjs/internal/http-protocol/getRobotsTxt.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reasons = require("../reasons"); +var _httpMethodsConstants = require("http-methods-constants"); +var _robotsTxtGuard = _interopRequireDefault(require("robots-txt-guard")); +var _isurl = _interopRequireDefault(require("isurl")); +var _robotsTxtParse = _interopRequireDefault(require("robots-txt-parse")); +var _request = _interopRequireDefault(require("./request")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * Download and parse a robots.txt file from a server's root path. + * @param {URL} url + * @param {object} auth + * @param {URLCache} cache + * @param {object} options + * @throws {TypeError} non-URL + * @returns {Promise} + */ +var _default = async (url, auth, cache, options) => { + if (!(0, _isurl.default)(url)) { + throw new TypeError(_reasons.BLC_INVALID); + } else { + url = new URL(url); + url.hash = ""; + url.pathname = "/robots.txt"; + url.search = ""; + const { + stream + } = await (0, _request.default)(url, auth, _httpMethodsConstants.GET, cache, options); + + // @todo https://github.com/tc39/proposal-pipeline-operator + return (0, _robotsTxtGuard.default)(await (0, _robotsTxtParse.default)(stream)); + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=getRobotsTxt.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/getRobotsTxt.js.map b/lib-cjs/internal/http-protocol/getRobotsTxt.js.map new file mode 100644 index 00000000..93cb0eee --- /dev/null +++ b/lib-cjs/internal/http-protocol/getRobotsTxt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getRobotsTxt.js","names":["_reasons","require","_httpMethodsConstants","_robotsTxtGuard","_interopRequireDefault","_isurl","_robotsTxtParse","_request","obj","__esModule","default","_default","url","auth","cache","options","isURL","TypeError","BLC_INVALID","URL","hash","pathname","search","stream","request","GET","guard","parse","exports","module"],"sources":["../../../lib/internal/http-protocol/getRobotsTxt.js"],"sourcesContent":["import {BLC_INVALID} from \"../reasons\";\nimport {GET} from \"http-methods-constants\";\nimport guard from \"robots-txt-guard\";\nimport isURL from \"isurl\";\nimport parse from \"robots-txt-parse\";\nimport request from \"./request\";\n\n\n\n/**\n * Download and parse a robots.txt file from a server's root path.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-URL\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\turl = new URL(url);\n\t\turl.hash = \"\";\n\t\turl.pathname = \"/robots.txt\";\n\t\turl.search = \"\";\n\n\t\tconst {stream} = await request(url, auth, GET, cache, options);\n\n\t\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t\treturn guard(await parse(stream));\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,eAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,QAAA,GAAAH,sBAAA,CAAAH,OAAA;AAAgC,SAAAG,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAAAG,QAAA,GASe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,IAAI,CAAC,IAAAC,cAAK,EAACJ,GAAG,CAAC,EACf;IACC,MAAM,IAAIK,SAAS,CAACC,oBAAW,CAAC;EACjC,CAAC,MAED;IACCN,GAAG,GAAG,IAAIO,GAAG,CAACP,GAAG,CAAC;IAClBA,GAAG,CAACQ,IAAI,GAAG,EAAE;IACbR,GAAG,CAACS,QAAQ,GAAG,aAAa;IAC5BT,GAAG,CAACU,MAAM,GAAG,EAAE;IAEf,MAAM;MAACC;IAAM,CAAC,GAAG,MAAM,IAAAC,gBAAO,EAACZ,GAAG,EAAEC,IAAI,EAAEY,yBAAG,EAAEX,KAAK,EAAEC,OAAO,CAAC;;IAE9D;IACA,OAAO,IAAAW,uBAAK,EAAC,MAAM,IAAAC,uBAAK,EAACJ,MAAM,CAAC,CAAC;EAClC;AACD,CAAC;AAAAK,OAAA,CAAAlB,OAAA,GAAAC,QAAA;AAAAkB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlB,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/index.js b/lib-cjs/internal/http-protocol/index.js new file mode 100644 index 00000000..8ed2560e --- /dev/null +++ b/lib-cjs/internal/http-protocol/index.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ExpectedHTMLMediaTypeError", { + enumerable: true, + get: function () { + return _errors.ExpectedHTMLMediaTypeError; + } +}); +Object.defineProperty(exports, "checkLink", { + enumerable: true, + get: function () { + return _checkLink.default; + } +}); +Object.defineProperty(exports, "getRobotsTxt", { + enumerable: true, + get: function () { + return _getRobotsTxt.default; + } +}); +Object.defineProperty(exports, "isCompatibleScheme", { + enumerable: true, + get: function () { + return _isCompatibleScheme.default; + } +}); +Object.defineProperty(exports, "streamHTML", { + enumerable: true, + get: function () { + return _streamHTML.default; + } +}); +Object.defineProperty(exports, "transitiveAuth", { + enumerable: true, + get: function () { + return _transitiveAuth.default; + } +}); +var _checkLink = _interopRequireDefault(require("./checkLink")); +var _getRobotsTxt = _interopRequireDefault(require("./getRobotsTxt")); +var _isCompatibleScheme = _interopRequireDefault(require("./isCompatibleScheme")); +var _streamHTML = _interopRequireDefault(require("./streamHTML")); +var _transitiveAuth = _interopRequireDefault(require("./transitiveAuth")); +var _errors = require("./errors"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/index.js.map b/lib-cjs/internal/http-protocol/index.js.map new file mode 100644 index 00000000..1efa1fe5 --- /dev/null +++ b/lib-cjs/internal/http-protocol/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_checkLink","_interopRequireDefault","require","_getRobotsTxt","_isCompatibleScheme","_streamHTML","_transitiveAuth","_errors","obj","__esModule","default"],"sources":["../../../lib/internal/http-protocol/index.js"],"sourcesContent":["// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as checkLink} from \"./checkLink\";\nexport {default as getRobotsTxt} from \"./getRobotsTxt\";\nexport {default as isCompatibleScheme} from \"./isCompatibleScheme\";\nexport {default as streamHTML} from \"./streamHTML\";\nexport {default as transitiveAuth} from \"./transitiveAuth\";\n\nexport {ExpectedHTMLMediaTypeError} from \"./errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAAoD,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/isCompatibleScheme.js b/lib-cjs/internal/http-protocol/isCompatibleScheme.js new file mode 100644 index 00000000..aa34a8c5 --- /dev/null +++ b/lib-cjs/internal/http-protocol/isCompatibleScheme.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +const SCHEMES = ["http:", "https:"]; + +/** + * Determine whether a URL supports an HTTP scheme/protocol. + * @param {URL} url + * @returns {boolean} + */ +var _default = url => SCHEMES.some(scheme => url.protocol === scheme); +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=isCompatibleScheme.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map b/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map new file mode 100644 index 00000000..192e22ad --- /dev/null +++ b/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isCompatibleScheme.js","names":["SCHEMES","_default","url","some","scheme","protocol","exports","default","module"],"sources":["../../../lib/internal/http-protocol/isCompatibleScheme.js"],"sourcesContent":["const SCHEMES = [\"http:\", \"https:\"];\n\n\n\n/**\n * Determine whether a URL supports an HTTP scheme/protocol.\n * @param {URL} url\n * @returns {boolean}\n */\nexport default url => SCHEMES.some(scheme => url.protocol === scheme);\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;;AAInC;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAKeC,GAAG,IAAIF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,GAAG,CAACG,QAAQ,KAAKD,MAAM,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAN,QAAA;AAAAO,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/request.js b/lib-cjs/internal/http-protocol/request.js new file mode 100644 index 00000000..ef47883c --- /dev/null +++ b/lib-cjs/internal/http-protocol/request.js @@ -0,0 +1,146 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reasons = require("../reasons"); +var _httpMethodsConstants = require("http-methods-constants"); +var _isurl = _interopRequireDefault(require("isurl")); +var _got = require("got"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const ERROR_EVENT = "error"; +const REDIRECT_EVENT = "redirect"; +const RESPONSE_EVENT = "response"; + +/** + * Create an HTTP request. + * @param {URL} url + * @param {object} auth + * @param {string} method + * @param {object} options + * @param {boolean} [isRetry] + * @returns {Promise} + */ +const createRequest = (url, auth, method, options, isRetry = false) => new Promise((resolve, reject) => { + const redirects = []; + (0, _got.stream)(url, { + auth: stringifyAuth(url, auth), + headers: { + "user-agent": options.userAgent, + ...options.customHeaders + }, + method, + rejectUnauthorized: false, + // accept self-signed SSL certificates + retry: 0, + throwHttpErrors: false + }).on(ERROR_EVENT, reject) + // @todo test http 303 + // @todo http 301/302 requests *can* have bodies, which could have links + .on(REDIRECT_EVENT, stream => redirects.push(simplifyResponse(stream))).on(RESPONSE_EVENT, stream => { + const response = simplifyResponse(stream, redirects); + if (!isRetry && method === _httpMethodsConstants.HEAD && options.retryHeadFail && options.retryHeadCodes.includes(response.status)) { + // Retry potentially broken server with GET + resolve(createRequest(url, auth, _httpMethodsConstants.GET, options, true)); + } else if (method === _httpMethodsConstants.GET && response.status >= 200 && response.status <= 299) { + resolve({ + response, + stream + }); + } else { + resolve({ + response + }); + } + }); +}); + +/** + * Create a simple response object from that of the "http" module. + * @param {object|Stream} response + * @param {Array} [redirects] + * @returns {object} + * @todo add response time -- https://github.com/sindresorhus/got/issues/874 + */ +const simplifyResponse = ({ + headers, + statusCode, + statusMessage, + url +}, redirects) => ({ + headers, + status: statusCode, + statusText: statusMessage, + url: new URL(url), + ...(redirects && { + redirects + }) // only return/destructure object if value is truthy +}); + +/** + * Convert an HTTP authentication URL or object into a string. + * @param {URL} url + * @param {object} auth + * @returns {string} + */ +const stringifyAuth = (url, auth) => { + if (url.password !== "" || url.username !== "") { + return `${url.username}:${url.password}`; + } else if (auth.password !== "" || auth.username !== "") { + return `${auth.username}:${auth.password}`; + } +}; + +/** + * Create an HTTP request and optionally cache the response. + * @param {URL} url + * @param {object} auth + * @param {string} method + * @param {URLCache} cache + * @param {object} options + * @throws {TypeError} non-URL + * @returns {Promise} + * @todo use `Promise.try()` instead of `async` + */ +var _default = async (url, auth, method, cache, options) => { + if (!(0, _isurl.default)(url)) { + throw new TypeError(_reasons.BLC_INVALID); + } else { + const promise = createRequest(url, auth, method, options); + if (options.cacheResponses) { + const cachedPromise = promise.then(({ + response + }) => { + // Replace cached promise + // @todo store in a "response" key, so that we can also store a list of all element IDs in the document + cache.set(url, response); + + // Any final redirect + // @todo store in a "response" key, so that we can also store a list of all element IDs in the document + cache.set(response.url, response); + + // Any intermediary redirects + response.redirects.forEach((redirect, i) => { + const subsequentRedirects = response.redirects.slice(i + 1); + + // @todo store in a "response" key, so that we can also store a list of all element IDs in the document + cache.set(redirect.url, { + ...response, + redirects: subsequentRedirects + }); + }); + return response; + }).catch(error => error); // pass-through + + // Make future response available to other requests before completion + // Will always overwrite previous value + // @todo store in a "response" key, so that we can also store a list of all element IDs in the document + cache.set(url, cachedPromise); + } + return promise; + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=request.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/request.js.map b/lib-cjs/internal/http-protocol/request.js.map new file mode 100644 index 00000000..28d0c51b --- /dev/null +++ b/lib-cjs/internal/http-protocol/request.js.map @@ -0,0 +1 @@ +{"version":3,"file":"request.js","names":["_reasons","require","_httpMethodsConstants","_isurl","_interopRequireDefault","_got","obj","__esModule","default","ERROR_EVENT","REDIRECT_EVENT","RESPONSE_EVENT","createRequest","url","auth","method","options","isRetry","Promise","resolve","reject","redirects","streamHTTP","stringifyAuth","headers","userAgent","customHeaders","rejectUnauthorized","retry","throwHttpErrors","on","stream","push","simplifyResponse","response","HEAD","retryHeadFail","retryHeadCodes","includes","status","GET","statusCode","statusMessage","statusText","URL","password","username","_default","cache","isURL","TypeError","BLC_INVALID","promise","cacheResponses","cachedPromise","then","set","forEach","redirect","i","subsequentRedirects","slice","catch","error","exports","module"],"sources":["../../../lib/internal/http-protocol/request.js"],"sourcesContent":["import {BLC_INVALID} from \"../reasons\";\nimport {GET, HEAD} from \"http-methods-constants\";\nimport isURL from \"isurl\";\nimport {stream as streamHTTP} from \"got\";\n\n\n\nconst ERROR_EVENT = \"error\";\nconst REDIRECT_EVENT = \"redirect\";\nconst RESPONSE_EVENT = \"response\";\n\n\n\n/**\n * Create an HTTP request.\n * @param {URL} url\n * @param {object} auth\n * @param {string} method\n * @param {object} options\n * @param {boolean} [isRetry]\n * @returns {Promise}\n */\nconst createRequest = (url, auth, method, options, isRetry=false) => new Promise((resolve, reject) =>\n{\n\tconst redirects = [];\n\n\tstreamHTTP(url,\n\t{\n\t\tauth: stringifyAuth(url, auth),\n\t\theaders: { \"user-agent\":options.userAgent, ...options.customHeaders },\n\t\tmethod,\n\t\trejectUnauthorized: false, // accept self-signed SSL certificates\n\t\tretry: 0,\n\t\tthrowHttpErrors: false\n\t})\n\t.on(ERROR_EVENT, reject)\n\t// @todo test http 303\n\t// @todo http 301/302 requests *can* have bodies, which could have links\n\t.on(REDIRECT_EVENT, stream => redirects.push( simplifyResponse(stream) ))\n\t.on(RESPONSE_EVENT, stream =>\n\t{\n\t\tconst response = simplifyResponse(stream, redirects);\n\n\t\tif (!isRetry && method===HEAD && options.retryHeadFail && options.retryHeadCodes.includes(response.status))\n\t\t{\n\t\t\t// Retry potentially broken server with GET\n\t\t\tresolve( createRequest(url, auth, GET, options, true) );\n\t\t}\n\t\telse if (method===GET && response.status>=200 && response.status<=299)\n\t\t{\n\t\t\tresolve({ response, stream });\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresolve({ response });\n\t\t}\n\t});\n});\n\n\n\n/**\n * Create a simple response object from that of the \"http\" module.\n * @param {object|Stream} response\n * @param {Array} [redirects]\n * @returns {object}\n * @todo add response time -- https://github.com/sindresorhus/got/issues/874\n */\nconst simplifyResponse = ({headers, statusCode, statusMessage, url}, redirects) =>\n({\n\theaders,\n\tstatus: statusCode,\n\tstatusText: statusMessage,\n\turl: new URL(url),\n\t...(redirects && {redirects}) // only return/destructure object if value is truthy\n});\n\n\n\n/**\n * Convert an HTTP authentication URL or object into a string.\n * @param {URL} url\n * @param {object} auth\n * @returns {string}\n */\nconst stringifyAuth = (url, auth) =>\n{\n\tif (url.password!==\"\" || url.username!==\"\")\n\t{\n\t\treturn `${url.username}:${url.password}`;\n\t}\n\telse if (auth.password!==\"\" || auth.username!==\"\")\n\t{\n\t\treturn `${auth.username}:${auth.password}`;\n\t}\n};\n\n\n\n/**\n * Create an HTTP request and optionally cache the response.\n * @param {URL} url\n * @param {object} auth\n * @param {string} method\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-URL\n * @returns {Promise}\n * @todo use `Promise.try()` instead of `async`\n */\nexport default async (url, auth, method, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\tconst promise = createRequest(url, auth, method, options);\n\n\t\tif (options.cacheResponses)\n\t\t{\n\t\t\tconst cachedPromise = promise\n\t\t\t.then(({response}) =>\n\t\t\t{\n\t\t\t\t// Replace cached promise\n\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\tcache.set(url, response);\n\n\t\t\t\t// Any final redirect\n\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\tcache.set(response.url, response);\n\n\t\t\t\t// Any intermediary redirects\n\t\t\t\tresponse.redirects.forEach((redirect, i) =>\n\t\t\t\t{\n\t\t\t\t\tconst subsequentRedirects = response.redirects.slice(i + 1);\n\n\t\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\t\tcache.set(redirect.url, {...response, redirects:subsequentRedirects});\n\t\t\t\t});\n\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch(error => error); // pass-through\n\n\t\t\t// Make future response available to other requests before completion\n\t\t\t// Will always overwrite previous value\n\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\tcache.set(url, cachedPromise);\n\t\t}\n\n\t\treturn promise;\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAAyC,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIzC,MAAMG,WAAW,GAAG,OAAO;AAC3B,MAAMC,cAAc,GAAG,UAAU;AACjC,MAAMC,cAAc,GAAG,UAAU;;AAIjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAGA,CAACC,GAAG,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,GAAC,KAAK,KAAK,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KACjG;EACC,MAAMC,SAAS,GAAG,EAAE;EAEpB,IAAAC,WAAU,EAACT,GAAG,EACd;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QACA;QACAc,KAAK,CAACQ,GAAG,CAACtB,QAAQ,CAACrB,GAAG,EAAEqB,QAAQ,CAAC;;QAEjC;QACAA,QAAQ,CAACb,SAAS,CAACoC,OAAO,CAAC,CAACC,QAAQ,EAAEC,CAAC,KACvC;UACC,MAAMC,mBAAmB,GAAG1B,QAAQ,CAACb,SAAS,CAACwC,KAAK,CAACF,CAAC,GAAG,CAAC,CAAC;;UAE3D;UACAX,KAAK,CAACQ,GAAG,CAACE,QAAQ,CAAC7C,GAAG,EAAE;YAAC,GAAGqB,QAAQ;YAAEb,SAAS,EAACuC;UAAmB,CAAC,CAAC;QACtE,CAAC,CAAC;QAEF,OAAO1B,QAAQ;MAChB,CAAC,CAAC,CACD4B,KAAK,CAACC,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAE;;MAEzB;MACA;MACA;MACAf,KAAK,CAACQ,GAAG,CAAC3C,GAAG,EAAEyC,aAAa,CAAC;IAC9B;IAEA,OAAOF,OAAO;EACf;AACD,CAAC;AAAAY,OAAA,CAAAxD,OAAA,GAAAuC,QAAA;AAAAkB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAxD,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/streamHTML.js b/lib-cjs/internal/http-protocol/streamHTML.js new file mode 100644 index 00000000..39418630 --- /dev/null +++ b/lib-cjs/internal/http-protocol/streamHTML.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _errors = require("./errors"); +var _httpMethodsConstants = require("http-methods-constants"); +var _errors2 = require("../errors"); +var _request = _interopRequireDefault(require("./request")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const CONTENT_TYPE = "content-type"; +const HTML_MIMETYPE = "text/html"; +const XHTML_MIMETYPE = "application/xhtml+xml"; + +/** + * Request a URL for its HTML contents. + * @param {URL} url + * @param {object} auth + * @param {URLCache} cache + * @param {object} options + * @throws {ExpectedHTMLMediaTypeError} if not HTML media type + * @throws {HTMLRetrievalError} 404, etc + * @throws {Error} if failed connection + * @returns {Promise} + */ +var _default = async (url, auth, cache, options) => { + const result = await (0, _request.default)(url, auth, _httpMethodsConstants.GET, cache, options); + const { + response: { + headers, + status + } + } = result; + if (status < 200 || status > 299) { + throw new _errors2.HTMLRetrievalError(status); + } else { + const type = headers[CONTENT_TYPE]; + + // Content-type is not mandatory in HTTP spec + // Could have trailing charset + if (!(type !== null && type !== void 0 && type.startsWith(HTML_MIMETYPE)) && !(type !== null && type !== void 0 && type.startsWith(XHTML_MIMETYPE))) { + throw new _errors.ExpectedHTMLMediaTypeError(type, status); + } + } + return result; +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=streamHTML.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/streamHTML.js.map b/lib-cjs/internal/http-protocol/streamHTML.js.map new file mode 100644 index 00000000..5174c8b3 --- /dev/null +++ b/lib-cjs/internal/http-protocol/streamHTML.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamHTML.js","names":["_errors","require","_httpMethodsConstants","_errors2","_request","_interopRequireDefault","obj","__esModule","default","CONTENT_TYPE","HTML_MIMETYPE","XHTML_MIMETYPE","_default","url","auth","cache","options","result","request","GET","response","headers","status","HTMLRetrievalError","type","startsWith","ExpectedHTMLMediaTypeError","exports","module"],"sources":["../../../lib/internal/http-protocol/streamHTML.js"],"sourcesContent":["import {ExpectedHTMLMediaTypeError} from \"./errors\";\nimport {GET} from \"http-methods-constants\";\nimport {HTMLRetrievalError} from \"../errors\";\nimport request from \"./request\";\n\n\n\nconst CONTENT_TYPE = \"content-type\";\nconst HTML_MIMETYPE = \"text/html\";\nconst XHTML_MIMETYPE = \"application/xhtml+xml\";\n\n\n\n/**\n * Request a URL for its HTML contents.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {ExpectedHTMLMediaTypeError} if not HTML media type\n * @throws {HTMLRetrievalError} 404, etc\n * @throws {Error} if failed connection\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tconst result = await request(url, auth, GET, cache, options);\n\tconst {response: {headers, status}} = result;\n\n\tif (status<200 || status>299)\n\t{\n\t\tthrow new HTMLRetrievalError(status);\n\t}\n\telse\n\t{\n\t\tconst type = headers[CONTENT_TYPE];\n\n\t\t// Content-type is not mandatory in HTTP spec\n\t\t// Could have trailing charset\n\t\tif (!type?.startsWith(HTML_MIMETYPE) && !type?.startsWith(XHTML_MIMETYPE))\n\t\t{\n\t\t\tthrow new ExpectedHTMLMediaTypeError(type, status);\n\t\t}\n\t}\n\n\treturn result;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAgC,SAAAI,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhC,MAAMG,YAAY,GAAG,cAAc;AACnC,MAAMC,aAAa,GAAG,WAAW;AACjC,MAAMC,cAAc,GAAG,uBAAuB;;AAI9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAC,QAAA,GAWe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,MAAMC,MAAM,GAAG,MAAM,IAAAC,gBAAO,EAACL,GAAG,EAAEC,IAAI,EAAEK,yBAAG,EAAEJ,KAAK,EAAEC,OAAO,CAAC;EAC5D,MAAM;IAACI,QAAQ,EAAE;MAACC,OAAO;MAAEC;IAAM;EAAC,CAAC,GAAGL,MAAM;EAE5C,IAAIK,MAAM,GAAC,GAAG,IAAIA,MAAM,GAAC,GAAG,EAC5B;IACC,MAAM,IAAIC,2BAAkB,CAACD,MAAM,CAAC;EACrC,CAAC,MAED;IACC,MAAME,IAAI,GAAGH,OAAO,CAACZ,YAAY,CAAC;;IAElC;IACA;IACA,IAAI,EAACe,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEC,UAAU,CAACf,aAAa,CAAC,KAAI,EAACc,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEC,UAAU,CAACd,cAAc,CAAC,GACzE;MACC,MAAM,IAAIe,kCAA0B,CAACF,IAAI,EAAEF,MAAM,CAAC;IACnD;EACD;EAEA,OAAOL,MAAM;AACd,CAAC;AAAAU,OAAA,CAAAnB,OAAA,GAAAI,QAAA;AAAAgB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAnB,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/transitiveAuth.js b/lib-cjs/internal/http-protocol/transitiveAuth.js new file mode 100644 index 00000000..670fefa4 --- /dev/null +++ b/lib-cjs/internal/http-protocol/transitiveAuth.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _isurl = _interopRequireDefault(require("isurl")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const DEFAULT_AUTH = Object.freeze({ + password: "", + username: "" +}); + +/** + * Possibly override `auth` with that from `url`. + * @param {URL} url + * @param {object} [auth] + * @returns {object} + */ +var _default = (url, auth = DEFAULT_AUTH) => { + if (!(0, _isurl.default)(url)) { + throw new TypeError("Invalid URL"); + } else if (url.username !== "" || url.password !== "") { + // Clone to avoid mutation + url = new URL(url); + auth = { + password: url.password, + username: url.username + }; + + // @todo is this the kind of result we want, with auth stored in `http` ? + url.password = ""; + url.username = ""; + } + return { + auth, + url + }; +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=transitiveAuth.js.map \ No newline at end of file diff --git a/lib-cjs/internal/http-protocol/transitiveAuth.js.map b/lib-cjs/internal/http-protocol/transitiveAuth.js.map new file mode 100644 index 00000000..f39f5bfb --- /dev/null +++ b/lib-cjs/internal/http-protocol/transitiveAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transitiveAuth.js","names":["_isurl","_interopRequireDefault","require","obj","__esModule","default","DEFAULT_AUTH","Object","freeze","password","username","_default","url","auth","isURL","TypeError","URL","exports","module"],"sources":["../../../lib/internal/http-protocol/transitiveAuth.js"],"sourcesContent":["import isURL from \"isurl\";\n\n\n\nconst DEFAULT_AUTH = Object.freeze({ password:\"\", username:\"\" });\n\n\n\n/**\n * Possibly override `auth` with that from `url`.\n * @param {URL} url\n * @param {object} [auth]\n * @returns {object}\n */\nexport default (url, auth=DEFAULT_AUTH) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(\"Invalid URL\");\n\t}\n\telse if (url.username!==\"\" || url.password!==\"\")\n\t{\n\t\t// Clone to avoid mutation\n\t\turl = new URL(url);\n\n\t\tauth =\n\t\t{\n\t\t\tpassword: url.password,\n\t\t\tusername: url.username\n\t\t};\n\n\t\t// @todo is this the kind of result we want, with auth stored in `http` ?\n\t\turl.password = \"\";\n\t\turl.username = \"\";\n\t}\n\n\treturn { auth, url };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1B,MAAMG,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC;EAAEC,QAAQ,EAAC,EAAE;EAAEC,QAAQ,EAAC;AAAG,CAAC,CAAC;;AAIhE;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAMeA,CAACC,GAAG,EAAEC,IAAI,GAACP,YAAY,KACtC;EACC,IAAI,CAAC,IAAAQ,cAAK,EAACF,GAAG,CAAC,EACf;IACC,MAAM,IAAIG,SAAS,CAAC,aAAa,CAAC;EACnC,CAAC,MACI,IAAIH,GAAG,CAACF,QAAQ,KAAG,EAAE,IAAIE,GAAG,CAACH,QAAQ,KAAG,EAAE,EAC/C;IACC;IACAG,GAAG,GAAG,IAAII,GAAG,CAACJ,GAAG,CAAC;IAElBC,IAAI,GACJ;MACCJ,QAAQ,EAAEG,GAAG,CAACH,QAAQ;MACtBC,QAAQ,EAAEE,GAAG,CAACF;IACf,CAAC;;IAED;IACAE,GAAG,CAACH,QAAQ,GAAG,EAAE;IACjBG,GAAG,CAACF,QAAQ,GAAG,EAAE;EAClB;EAEA,OAAO;IAAEG,IAAI;IAAED;EAAI,CAAC;AACrB,CAAC;AAAAK,OAAA,CAAAZ,OAAA,GAAAM,QAAA;AAAAO,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAZ,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/matchURL.js b/lib-cjs/internal/matchURL.js new file mode 100644 index 00000000..5a2fd542 --- /dev/null +++ b/lib-cjs/internal/matchURL.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _matcher = require("matcher"); +/** + * Determine if a URL contains at least one—possibly glob'bed—keyword. + * @param {string} url + * @param {Array} keywords + * @returns {boolean} + */ +var _default = (url, keywords) => keywords.some(keyword => { + // Check for literal keyword + if (url.includes(keyword)) { + return true; + } else { + // Check for glob + return (0, _matcher.isMatch)(url, keyword); + } +}); +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=matchURL.js.map \ No newline at end of file diff --git a/lib-cjs/internal/matchURL.js.map b/lib-cjs/internal/matchURL.js.map new file mode 100644 index 00000000..9c7329c9 --- /dev/null +++ b/lib-cjs/internal/matchURL.js.map @@ -0,0 +1 @@ +{"version":3,"file":"matchURL.js","names":["_matcher","require","_default","url","keywords","some","keyword","includes","isMatch","exports","default","module"],"sources":["../../lib/internal/matchURL.js"],"sourcesContent":["import {isMatch} from \"matcher\";\n\n\n\n/**\n * Determine if a URL contains at least one—possibly glob'bed—keyword.\n * @param {string} url\n * @param {Array} keywords\n * @returns {boolean}\n */\nexport default (url, keywords) => keywords.some(keyword =>\n{\n\t// Check for literal keyword\n\tif (url.includes(keyword))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\t// Check for glob\n\t\treturn isMatch(url, keyword);\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAMeA,CAACC,GAAG,EAAEC,QAAQ,KAAKA,QAAQ,CAACC,IAAI,CAACC,OAAO,IACvD;EACC;EACA,IAAIH,GAAG,CAACI,QAAQ,CAACD,OAAO,CAAC,EACzB;IACC,OAAO,IAAI;EACZ,CAAC,MAED;IACC;IACA,OAAO,IAAAE,gBAAO,EAACL,GAAG,EAAEG,OAAO,CAAC;EAC7B;AACD,CAAC,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAR,QAAA;AAAAS,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/parseHTML.js b/lib-cjs/internal/parseHTML.js new file mode 100644 index 00000000..76851422 --- /dev/null +++ b/lib-cjs/internal/parseHTML.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default2 = _interopRequireDefault(require("parse5/lib/tree-adapters/default")); +var _isStream = _interopRequireDefault(require("is-stream")); +var _isString = _interopRequireDefault(require("is-string")); +var _parse = require("parse5"); +var _parse5ParserStream = _interopRequireDefault(require("parse5-parser-stream")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const ERROR_EVENT = "error"; +const FINISH_EVENT = "finish"; +const OPTIONS = { + sourceCodeLocationInfo: true, + treeAdapter: { + ..._default2.default, + createElement: (...args) => { + const result = _default2.default.createElement(...args); + result.attrMap = simplifyAttrs(result.attrs); + return result; + } + } +}; + +/** + * Convert a list of parse5 attributes into key-value pairs. + * Note: spec-compliant HTML cannot have multiple attrs of the same name. + * @param {Array} attrs + * @returns {object} + * + * @todo https://github.com/tc39/proposal-pipeline-operator + */ +const simplifyAttrs = attrs => Object.fromEntries(attrs.map(({ + name, + value +}) => [name, value])); + +/** + * Parse an HTML stream/string and return a tree. + * @param {Stream|string} input + * @throws {TypeError} non-Stream or non-string + * @returns {Promise} + */ +var _default = input => new Promise((resolve, reject) => { + if ((0, _isStream.default)(input)) { + const parser = new _parse5ParserStream.default(OPTIONS).once(ERROR_EVENT, reject) // @todo test this + .once(FINISH_EVENT, () => resolve(parser.document)); + input.setEncoding("utf8").pipe(parser); + } else if ((0, _isString.default)(input)) { + resolve((0, _parse.parse)(input, OPTIONS)); + } else { + reject(new TypeError("Invalid input")); + } +}); +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=parseHTML.js.map \ No newline at end of file diff --git a/lib-cjs/internal/parseHTML.js.map b/lib-cjs/internal/parseHTML.js.map new file mode 100644 index 00000000..6c70e0ba --- /dev/null +++ b/lib-cjs/internal/parseHTML.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseHTML.js","names":["_default2","_interopRequireDefault","require","_isStream","_isString","_parse","_parse5ParserStream","obj","__esModule","default","ERROR_EVENT","FINISH_EVENT","OPTIONS","sourceCodeLocationInfo","treeAdapter","defaultTreeAdapter","createElement","args","result","attrMap","simplifyAttrs","attrs","Object","fromEntries","map","name","value","_default","input","Promise","resolve","reject","isStream","parser","ParserStream","once","document","setEncoding","pipe","isString","parse","TypeError","exports","module"],"sources":["../../lib/internal/parseHTML.js"],"sourcesContent":["import defaultTreeAdapter from \"parse5/lib/tree-adapters/default\";\nimport isStream from \"is-stream\";\nimport isString from \"is-string\";\nimport {parse} from \"parse5\";\nimport ParserStream from \"parse5-parser-stream\";\n\n\n\nconst ERROR_EVENT = \"error\";\nconst FINISH_EVENT = \"finish\";\n\n\n\nconst OPTIONS =\n{\n\tsourceCodeLocationInfo: true,\n\ttreeAdapter:\n\t{\n\t\t...defaultTreeAdapter,\n\n\t\tcreateElement: (...args) =>\n\t\t{\n\t\t\tconst result = defaultTreeAdapter.createElement(...args);\n\t\t\tresult.attrMap = simplifyAttrs(result.attrs);\n\t\t\treturn result;\n\t\t}\n\t}\n};\n\n\n\n/**\n * Convert a list of parse5 attributes into key-value pairs.\n * Note: spec-compliant HTML cannot have multiple attrs of the same name.\n * @param {Array} attrs\n * @returns {object}\n *\n * @todo https://github.com/tc39/proposal-pipeline-operator\n */\nconst simplifyAttrs = attrs => Object.fromEntries(attrs.map(({name, value}) => [name, value]));\n\n\n\n/**\n * Parse an HTML stream/string and return a tree.\n * @param {Stream|string} input\n * @throws {TypeError} non-Stream or non-string\n * @returns {Promise}\n */\nexport default input => new Promise((resolve, reject) =>\n{\n\tif (isStream(input))\n\t{\n\t\tconst parser = new ParserStream(OPTIONS)\n\t\t.once(ERROR_EVENT, reject) // @todo test this\n\t\t.once(FINISH_EVENT, () => resolve(parser.document));\n\n\t\tinput\n\t\t\t.setEncoding(\"utf8\")\n\t\t\t.pipe(parser);\n\t}\n\telse if (isString(input))\n\t{\n\t\tresolve( parse(input, OPTIONS) );\n\t}\n\telse\n\t{\n\t\treject( new TypeError(\"Invalid input\") );\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhD,MAAMG,WAAW,GAAG,OAAO;AAC3B,MAAMC,YAAY,GAAG,QAAQ;AAI7B,MAAMC,OAAO,GACb;EACCC,sBAAsB,EAAE,IAAI;EAC5BC,WAAW,EACX;IACC,GAA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newline at end of file diff --git a/lib-cjs/internal/parseOptions.js b/lib-cjs/internal/parseOptions.js new file mode 100644 index 00000000..7946e2b1 --- /dev/null +++ b/lib-cjs/internal/parseOptions.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _defaultOptions = _interopRequireDefault(require("./defaultOptions")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const HAS_BEEN_PARSED_VALUE = Symbol(); + +/** + * Combine consumer options with defaults, then normalize/optimize. + * @param {object} [options] + * @returns {object} + */ +var _default = (options = {}) => { + if (options.__parsed !== HAS_BEEN_PARSED_VALUE) { + options = { + ..._defaultOptions.default, + ...options + }; + + // https://npmjs.com/request-methods-constants are upper case + options.requestMethod = options.requestMethod.toUpperCase(); + + // Undocumented -- avoids reparsing options passed through from class to class + options.__parsed = HAS_BEEN_PARSED_VALUE; + } + return options; +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=parseOptions.js.map \ No newline at end of file diff --git a/lib-cjs/internal/parseOptions.js.map b/lib-cjs/internal/parseOptions.js.map new file mode 100644 index 00000000..da149c7e --- /dev/null +++ b/lib-cjs/internal/parseOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseOptions.js","names":["_defaultOptions","_interopRequireDefault","require","obj","__esModule","default","HAS_BEEN_PARSED_VALUE","Symbol","_default","options","__parsed","DEFAULT_OPTIONS","requestMethod","toUpperCase","exports","module"],"sources":["../../lib/internal/parseOptions.js"],"sourcesContent":["import DEFAULT_OPTIONS from \"./defaultOptions\";\n\n\n\nconst HAS_BEEN_PARSED_VALUE = Symbol();\n\n\n\n/**\n * Combine consumer options with defaults, then normalize/optimize.\n * @param {object} [options]\n * @returns {object}\n */\nexport default (options = {}) =>\n{\n\tif (options.__parsed !== HAS_BEEN_PARSED_VALUE)\n\t{\n\t\toptions = { ...DEFAULT_OPTIONS, ...options };\n\n\t\t// https://npmjs.com/request-methods-constants are upper case\n\t\toptions.requestMethod = options.requestMethod.toUpperCase();\n\n\t\t// Undocumented -- avoids reparsing options passed through from class to class\n\t\toptions.__parsed = HAS_BEEN_PARSED_VALUE;\n\t}\n\n\treturn options;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI/C,MAAMG,qBAAqB,GAAGC,MAAM,CAAC,CAAC;;AAItC;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAKeA,CAACC,OAAO,GAAG,CAAC,CAAC,KAC5B;EACC,IAAIA,OAAO,CAACC,QAAQ,KAAKJ,qBAAqB,EAC9C;IACCG,OAAO,GAAG;MAAE,GAAGE,uBAAe;MAAE,GAAGF;IAAQ,CAAC;;IAE5C;IACAA,OAAO,CAACG,aAAa,GAAGH,OAAO,CAACG,aAAa,CAACC,WAAW,CAAC,CAAC;;IAE3D;IACAJ,OAAO,CAACC,QAAQ,GAAGJ,qBAAqB;EACzC;EAEA,OAAOG,OAAO;AACf,CAAC;AAAAK,OAAA,CAAAT,OAAA,GAAAG,QAAA;AAAAO,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAT,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/reasons.js b/lib-cjs/internal/reasons.js new file mode 100644 index 00000000..4c36ad96 --- /dev/null +++ b/lib-cjs/internal/reasons.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _errno = require("errno"); +var _http = require("http"); +var _default = exports.default = Object.freeze({ + BLC_CUSTOM: "Custom exclusion", + BLC_DIRECTORY: "File system directory exclusion", + BLC_EXTERNAL: "External URL exclusion", + BLC_HTML: "HTML exclusion", + BLC_INTERNAL: "Internal URL exclusion", + BLC_INVALID: "Invalid URL", + BLC_KEYWORD: "Keyword exclusion", + BLC_ROBOTS: "Robots exclusion", + BLC_SAMEPAGE: "Same-Page URL exclusion", + BLC_UNKNOWN: "Unknown error", + BLC_UNSUPPORTED: "Unsupported URL", + // https://github.com/rvagg/node-errno/issues/14 + ERRNO_ENOTFOUND: "no matching dns record (ENOTFOUND)", + // @todo https://github.com/tc39/proposal-pipeline-operator + ...Object.fromEntries(_errno.all.map(({ + code, + description + }) => [`ERRNO_${code}`, `${description} (${code})`])), + // @todo https://github.com/tc39/proposal-pipeline-operator + ...Object.fromEntries(Object.entries(_http.STATUS_CODES).map(([key, value]) => [`HTTP_${key}`, `${value} (${key})`])) +}); +module.exports = exports.default; +//# sourceMappingURL=reasons.js.map \ No newline at end of file diff --git a/lib-cjs/internal/reasons.js.map b/lib-cjs/internal/reasons.js.map new file mode 100644 index 00000000..bc5ac7f3 --- /dev/null +++ b/lib-cjs/internal/reasons.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reasons.js","names":["_errno","require","_http","_default","exports","default","Object","freeze","BLC_CUSTOM","BLC_DIRECTORY","BLC_EXTERNAL","BLC_HTML","BLC_INTERNAL","BLC_INVALID","BLC_KEYWORD","BLC_ROBOTS","BLC_SAMEPAGE","BLC_UNKNOWN","BLC_UNSUPPORTED","ERRNO_ENOTFOUND","fromEntries","ERRNO","map","code","description","entries","HTTP","key","value","module"],"sources":["../../lib/internal/reasons.js"],"sourcesContent":["import {all as ERRNO} from \"errno\";\nimport {STATUS_CODES as HTTP} from \"http\";\n\n\n\nexport default Object.freeze(\n{\n\tBLC_CUSTOM: \"Custom exclusion\",\n\tBLC_DIRECTORY: \"File system directory exclusion\",\n\tBLC_EXTERNAL: \"External URL exclusion\",\n\tBLC_HTML: \"HTML exclusion\",\n\tBLC_INTERNAL: \"Internal URL exclusion\",\n\tBLC_INVALID: \"Invalid URL\",\n\tBLC_KEYWORD: \"Keyword exclusion\",\n\tBLC_ROBOTS: \"Robots exclusion\",\n\tBLC_SAMEPAGE: \"Same-Page URL exclusion\",\n\tBLC_UNKNOWN: \"Unknown error\",\n\tBLC_UNSUPPORTED: \"Unsupported URL\",\n\n\t// https://github.com/rvagg/node-errno/issues/14\n\tERRNO_ENOTFOUND: \"no matching dns record (ENOTFOUND)\",\n\n\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t...Object.fromEntries\n\t(\n\t\tERRNO.map(({code, description}) => [`ERRNO_${code}`, `${description} (${code})`])\n\t),\n\n\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t...Object.fromEntries\n\t(\n\t\tObject.entries(HTTP).map(([key, value]) => [`HTTP_${key}`, `${value} (${key})`])\n\t)\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAA0C,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAI3BC,MAAM,CAACC,MAAM,CAC5B;EACCC,UAAU,EAAE,kBAAkB;EAC9BC,aAAa,EAAE,iCAAiC;EAChDC,YAAY,EAAE,wBAAwB;EACtCC,QAAQ,EAAE,gBAAgB;EAC1BC,YAAY,EAAE,wBAAwB;EACtCC,WAAW,EAAE,aAAa;EAC1BC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,YAAY,EAAE,yBAAyB;EACvCC,WAAW,EAAE,eAAe;EAC5BC,eAAe,EAAE,iBAAiB;EAElC;EACAC,eAAe,EAAE,oCAAoC;EAErD;EACA,GAAGb,MAAM,CAACc,WAAW,CAEpBC,UAAK,CAACC,GAAG,CAAC,CAAC;IAACC,IAAI;IAAEC;EAAW,CAAC,KAAK,CAAE,SAAQD,IAAK,EAAC,EAAG,GAAEC,WAAY,KAAID,IAAK,GAAE,CAAC,CACjF,CAAC;EAED;EACA,GAAGjB,MAAM,CAACc,WAAW,CAEpBd,MAAM,CAACmB,OAAO,CAACC,kBAAI,CAAC,CAACJ,GAAG,CAAC,CAAC,CAACK,GAAG,EAAEC,KAAK,CAAC,KAAK,CAAE,QAAOD,GAAI,EAAC,EAAG,GAAEC,KAAM,KAAID,GAAI,GAAE,CAAC,CAChF;AACD,CAAC,CAAC;AAAAE,MAAA,CAAAzB,OAAA,GAAAA,OAAA,CAAAC,OAAA"} \ No newline at end of file diff --git a/lib-cjs/internal/scrapeHTML.js b/lib-cjs/internal/scrapeHTML.js new file mode 100644 index 00000000..ae42debc --- /dev/null +++ b/lib-cjs/internal/scrapeHTML.js @@ -0,0 +1,269 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _condenseWhitespace = _interopRequireDefault(require("condense-whitespace")); +var _Link = _interopRequireWildcard(require("./Link")); +var _httpEquivRefresh = _interopRequireDefault(require("http-equiv-refresh")); +var _parseSrcset = _interopRequireDefault(require("parse-srcset")); +var _robotDirectives = _interopRequireDefault(require("robot-directives")); +var _tags = _interopRequireDefault(require("./tags")); +var _walkParse = _interopRequireDefault(require("walk-parse5")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const MAX_FILTER_LEVEL = _tags.default[_tags.default.length - 1]; +const ALL_NODE_ATTRS = MAX_FILTER_LEVEL["*"]; +const SPECIAL_NODE_NAME_PREFIX = "#"; +const BASE_NODE_NAME = "base"; +const BODY_NODE_NAME = "body"; +const COMMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}comment`; +const DOCUMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}document`; +const HEAD_NODE_NAME = "head"; +const HTML_NODE_NAME = "html"; +const META_NODE_NAME = "meta"; +const TEXT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}text`; +const CONTENT_ATTR_NAME = "content"; +const HREF_ATTR_NAME = "href"; +const HTTP_EQUIV_ATTR_NAME = "http-equiv"; +const NAME_ATTR_NAME = "name"; +const PING_ATTR_NAME = "ping"; +const SRCSET_ATTR_NAME = "srcset"; +const REFRESH_ATTR_VALUE = "refresh"; +const ROBOTS_ATTR_VALUE = "robots"; + +/** + * Traverse the root node (synchronously) and return located links via a callback function. + * @param {object} rootNode + * @param {Function} callback + */ +const findLinks = (rootNode, callback) => { + (0, _walkParse.default)(rootNode, node => { + if (node.nodeName !== COMMENT_NODE_NAME && node.nodeName !== TEXT_NODE_NAME) { + const filteredNodeAttrs = MAX_FILTER_LEVEL[node.nodeName] ?? {}; + node.attrs.forEach(({ + name: attrName, + value: attrValue + }) => { + let url = null; + + // If a supported attribute + if (attrName in filteredNodeAttrs || attrName in ALL_NODE_ATTRS) { + switch (attrName) { + case CONTENT_ATTR_NAME: + { + var _node$attrMap$HTTP_EQ; + // Special case for `` + // No browser supports a value surrounded by spaces, so `trim()` is not used + if (((_node$attrMap$HTTP_EQ = node.attrMap[HTTP_EQUIV_ATTR_NAME]) === null || _node$attrMap$HTTP_EQ === void 0 ? void 0 : _node$attrMap$HTTP_EQ.toLowerCase()) === REFRESH_ATTR_VALUE) { + url = (0, _httpEquivRefresh.default)(attrValue).url; + } + break; + } + case PING_ATTR_NAME: + { + url = attrValue.split(" ").filter(pingURL => pingURL !== ""); + break; + } + case SRCSET_ATTR_NAME: + { + url = (0, _parseSrcset.default)(attrValue).map(image => image.url); + break; + } + default: + { + // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces + url = attrValue.trim(); + } + } + if (Array.isArray(url)) { + url.forEach(_url => callback(node, attrName, _url)); + } else if (url != null) { + callback(node, attrName, url); + } + } + }); + } + }); +}; + +/** + * Traverse the root node to locate preliminary elements/data. + * + * + * + * Looks for the first instance. If no `href` attribute exists, + * the element is ignored and possible successors are considered. + * + * + * + * Looks for all robot instances and cascades the values. + * + * @param {object} rootNode + * @param {RobotDirectives} robots + * @returns {object} + */ +const findPreliminaries = (rootNode, robots) => { + const result = { + base: null + }; + (0, _walkParse.default)(rootNode, ({ + attrMap, + nodeName + }) => { + switch (nodeName) { + // `` can be anywhere, not just within `` + case BASE_NODE_NAME: + { + if (result.base === null && HREF_ATTR_NAME in attrMap) { + // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces + result.base = attrMap[HREF_ATTR_NAME].trim(); + } + break; + } + // `` can be anywhere + case META_NODE_NAME: + { + if (robots && NAME_ATTR_NAME in attrMap && CONTENT_ATTR_NAME in attrMap) { + const name = attrMap[NAME_ATTR_NAME].trim().toLowerCase(); + if (name === ROBOTS_ATTR_VALUE || _robotDirectives.default.isBot(name)) { + robots.meta(name, attrMap[CONTENT_ATTR_NAME]); + } + } + break; + } + } + if (result.base !== null && !robots) { + // Kill walk + return false; + } + }); + return result; +}; + +/** + * Find the `` element. + * @param {object} document + * @returns {object} + */ +const findRootNode = document => document.childNodes.find(childNode => { + // Doctypes have no `childNodes` property + // HTML can only have one true root node + if (childNode.childNodes != null) { + return childNode; + } +}); + +/** + * Find a node's `:nth-child()` index among its siblings. + * @param {object} node + * @returns {number} + */ +const getNthIndex = node => { + const parentsChildren = node.parentNode.childNodes; + let count = 0; + parentsChildren.every(child => { + if (child !== node) { + // Exclude non-element nodes + if (!child.nodeName.startsWith(SPECIAL_NODE_NAME_PREFIX)) { + count++; + } + return true; + } else { + return false; + } + }); + + // `:nth-child()` indices don't start at 0 + return count + 1; +}; + +/** + * Produces a CSS selector that matches an element. + * @param {object} node + * @returns {string} + */ +const getSelector = node => { + const selector = []; + while (node.nodeName !== DOCUMENT_NODE_NAME) { + let name = node.nodeName; + + // Only one of these are ever allowed per document -- so, index is unnecessary + if (name !== HTML_NODE_NAME && name !== BODY_NODE_NAME & name !== HEAD_NODE_NAME) { + name += `:nth-child(${getNthIndex(node)})`; + } + + // Building backwards + selector.push(name); + node = node.parentNode; + } + return selector.reverse().join(" > "); +}; + +/** + * Produces an `innerText` value for text nodes within an element. + * @param {object} node + * @returns {string|null} + */ +const getText = node => { + let text = null; + if (node.childNodes.length > 0) { + text = ""; + (0, _walkParse.default)(node, ({ + nodeName, + value + }) => { + if (nodeName === TEXT_NODE_NAME) { + text += value; + } + }); + + // @todo don't normalize if within
 ? use "normalize-html-whitespace" package if so
+    text = (0, _condenseWhitespace.default)(text);
+  }
+  return text;
+};
+
+/**
+ * Serialize an HTML element into a string.
+ * @param {object} node
+ * @returns {string}
+ */
+const stringifyNode = ({
+  attrs,
+  nodeName
+}) => {
+  const attrsString = attrs.reduce((result, {
+    name,
+    value
+  }) => `${result} ${name}="${value}"`, "");
+  return `<${nodeName}${attrsString}>`;
+};
+
+/**
+ * Scrape a parsed HTML document/tree for links.
+ * @param {object} document
+ * @param {URL|string} pageURL
+ * @param {RobotDirectives} robots
+ * @returns {Array}
+ */
+var _default = (document, pageURL, robots) => {
+  const links = [];
+  const rootNode = findRootNode(document);
+  const {
+    base
+  } = findPreliminaries(rootNode, robots);
+  findLinks(rootNode, (node, attrName, url) => {
+    var _node$sourceCodeLocat;
+    // Elements added for compliance (not from HTML source) have no location
+    const location = ((_node$sourceCodeLocat = node.sourceCodeLocation) === null || _node$sourceCodeLocat === void 0 ? void 0 : _node$sourceCodeLocat.attrs[attrName]) ?? null;
+    const link = new _Link.default().set(_Link.HTML_ATTR_NAME, attrName).set(_Link.HTML_ATTRS, node.attrMap).set(_Link.HTML_BASE_HREF, base).set(_Link.HTML_INDEX, links.length).set(_Link.HTML_LOCATION, location).set(_Link.HTML_SELECTOR, getSelector(node)).set(_Link.HTML_TAG, stringifyNode(node)).set(_Link.HTML_TAG_NAME, node.nodeName).set(_Link.HTML_TEXT, getText(node)).resolve(url, pageURL);
+    links.push(link);
+  });
+  return links;
+};
+exports.default = _default;
+module.exports = exports.default;
+//# sourceMappingURL=scrapeHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/scrapeHTML.js.map b/lib-cjs/internal/scrapeHTML.js.map
new file mode 100644
index 00000000..0753da69
--- /dev/null
+++ b/lib-cjs/internal/scrapeHTML.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"scrapeHTML.js","names":["_condenseWhitespace","_interopRequireDefault","require","_Link","_interopRequireWildcard","_httpEquivRefresh","_parseSrcset","_robotDirectives","_tags","_walkParse","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","MAX_FILTER_LEVEL","TAGS","length","ALL_NODE_ATTRS","SPECIAL_NODE_NAME_PREFIX","BASE_NODE_NAME","BODY_NODE_NAME","COMMENT_NODE_NAME","DOCUMENT_NODE_NAME","HEAD_NODE_NAME","HTML_NODE_NAME","META_NODE_NAME","TEXT_NODE_NAME","CONTENT_ATTR_NAME","HREF_ATTR_NAME","HTTP_EQUIV_ATTR_NAME","NAME_ATTR_NAME","PING_ATTR_NAME","SRCSET_ATTR_NAME","REFRESH_ATTR_VALUE","ROBOTS_ATTR_VALUE","findLinks","rootNode","callback","walk","node","nodeName","filteredNodeAttrs","attrs","forEach","name","attrName","value","attrValue","url","_node$attrMap$HTTP_EQ","attrMap","toLowerCase","parseMetaRefresh","split","filter","pingURL","parseSrcset","map","image","trim","Array","isArray","_url","findPreliminaries","robots","result","base","RobotDirectives","isBot","meta","findRootNode","document","childNodes","find","childNode","getNthIndex","parentsChildren","parentNode","count","every","child","startsWith","getSelector","selector","push","reverse","join","getText","text","condenseWhitespace","stringifyNode","attrsString","reduce","_default","pageURL","links","_node$sourceCodeLocat","location","sourceCodeLocation","link","Link","HTML_ATTR_NAME","HTML_ATTRS","HTML_BASE_HREF","HTML_INDEX","HTML_LOCATION","HTML_SELECTOR","HTML_TAG","HTML_TAG_NAME","HTML_TEXT","resolve","exports","module"],"sources":["../../lib/internal/scrapeHTML.js"],"sourcesContent":["import condenseWhitespace from \"condense-whitespace\";\nimport Link, {HTML_ATTR_NAME, HTML_ATTRS, HTML_BASE_HREF, HTML_INDEX, HTML_LOCATION, HTML_SELECTOR, HTML_TAG, HTML_TAG_NAME, HTML_TEXT} from \"./Link\";\nimport parseMetaRefresh from \"http-equiv-refresh\";\nimport parseSrcset from \"parse-srcset\";\nimport RobotDirectives from \"robot-directives\";\nimport TAGS from \"./tags\";\nimport walk from \"walk-parse5\";\n\n\n\nconst MAX_FILTER_LEVEL = TAGS[TAGS.length - 1];\nconst ALL_NODE_ATTRS = MAX_FILTER_LEVEL[\"*\"];\n\nconst SPECIAL_NODE_NAME_PREFIX = \"#\";\n\nconst BASE_NODE_NAME = \"base\";\nconst BODY_NODE_NAME = \"body\";\nconst COMMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}comment`;\nconst DOCUMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}document`;\nconst HEAD_NODE_NAME = \"head\";\nconst HTML_NODE_NAME = \"html\";\nconst META_NODE_NAME = \"meta\";\nconst TEXT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}text`;\n\nconst CONTENT_ATTR_NAME = \"content\";\nconst HREF_ATTR_NAME = \"href\";\nconst HTTP_EQUIV_ATTR_NAME = \"http-equiv\";\nconst NAME_ATTR_NAME = \"name\";\nconst PING_ATTR_NAME = \"ping\";\nconst SRCSET_ATTR_NAME = \"srcset\";\n\nconst REFRESH_ATTR_VALUE = \"refresh\";\nconst ROBOTS_ATTR_VALUE = \"robots\";\n\n\n\n/**\n * Traverse the root node (synchronously) and return located links via a callback function.\n * @param {object} rootNode\n * @param {Function} callback\n */\nconst findLinks = (rootNode, callback) =>\n{\n\twalk(rootNode, node =>\n\t{\n\t\tif (node.nodeName!==COMMENT_NODE_NAME && node.nodeName!==TEXT_NODE_NAME)\n\t\t{\n\t\t\tconst filteredNodeAttrs = MAX_FILTER_LEVEL[node.nodeName] ?? {};\n\n\t\t\tnode.attrs.forEach(({name:attrName, value:attrValue}) =>\n\t\t\t{\n\t\t\t\tlet url = null;\n\n\t\t\t\t// If a supported attribute\n\t\t\t\tif (attrName in filteredNodeAttrs || attrName in ALL_NODE_ATTRS)\n\t\t\t\t{\n\t\t\t\t\tswitch (attrName)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase CONTENT_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Special case for ``\n\t\t\t\t\t\t\t// No browser supports a value surrounded by spaces, so `trim()` is not used\n\t\t\t\t\t\t\tif (node.attrMap[HTTP_EQUIV_ATTR_NAME]?.toLowerCase() === REFRESH_ATTR_VALUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl = parseMetaRefresh(attrValue).url;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase PING_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl = attrValue.split(\" \").filter(pingURL => pingURL !== \"\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase SRCSET_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl = parseSrcset(attrValue).map(image => image.url);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces\n\t\t\t\t\t\t\turl = attrValue.trim();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Array.isArray(url))\n\t\t\t\t\t{\n\t\t\t\t\t\turl.forEach(_url => callback(node, attrName, _url));\n\t\t\t\t\t}\n\t\t\t\t\telse if (url != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcallback(node, attrName, url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n};\n\n\n\n/**\n * Traverse the root node to locate preliminary elements/data.\n *\n * \n *\n * \tLooks for the first instance. If no `href` attribute exists,\n * \tthe element is ignored and possible successors are considered.\n *\n * \n *\n * \tLooks for all robot instances and cascades the values.\n *\n * @param {object} rootNode\n * @param {RobotDirectives} robots\n * @returns {object}\n */\nconst findPreliminaries = (rootNode, robots) =>\n{\n\tconst result = { base:null };\n\n\twalk(rootNode, ({attrMap, nodeName}) =>\n\t{\n\t\tswitch (nodeName)\n\t\t{\n\t\t\t// `` can be anywhere, not just within ``\n\t\t\tcase BASE_NODE_NAME:\n\t\t\t{\n\t\t\t\tif (result.base===null && HREF_ATTR_NAME in attrMap)\n\t\t\t\t{\n\t\t\t\t\t// https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces\n\t\t\t\t\tresult.base = attrMap[HREF_ATTR_NAME].trim();\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// `` can be anywhere\n\t\t\tcase META_NODE_NAME:\n\t\t\t{\n\t\t\t\tif (robots && NAME_ATTR_NAME in attrMap && CONTENT_ATTR_NAME in attrMap)\n\t\t\t\t{\n\t\t\t\t\tconst name = attrMap[NAME_ATTR_NAME].trim().toLowerCase();\n\n\t\t\t\t\tif (name===ROBOTS_ATTR_VALUE || RobotDirectives.isBot(name))\n\t\t\t\t\t{\n\t\t\t\t\t\trobots.meta(name, attrMap[CONTENT_ATTR_NAME]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (result.base!==null && !robots)\n\t\t{\n\t\t\t// Kill walk\n\t\t\treturn false;\n\t\t}\n\t});\n\n\treturn result;\n};\n\n\n\n/**\n * Find the `` element.\n * @param {object} document\n * @returns {object}\n */\nconst findRootNode = document => document.childNodes.find(childNode =>\n{\n\t// Doctypes have no `childNodes` property\n\t// HTML can only have one true root node\n\tif (childNode.childNodes != null)\n\t{\n\t\treturn childNode;\n\t}\n});\n\n\n\n/**\n * Find a node's `:nth-child()` index among its siblings.\n * @param {object} node\n * @returns {number}\n */\nconst getNthIndex = node =>\n{\n\tconst parentsChildren = node.parentNode.childNodes;\n\tlet count = 0;\n\n\tparentsChildren.every(child =>\n\t{\n\t\tif (child !== node)\n\t\t{\n\t\t\t// Exclude non-element nodes\n\t\t\tif (!child.nodeName.startsWith(SPECIAL_NODE_NAME_PREFIX))\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t});\n\n\t// `:nth-child()` indices don't start at 0\n\treturn count + 1;\n};\n\n\n\n/**\n * Produces a CSS selector that matches an element.\n * @param {object} node\n * @returns {string}\n */\nconst getSelector = node =>\n{\n\tconst selector = [];\n\n\twhile (node.nodeName !== DOCUMENT_NODE_NAME)\n\t{\n\t\tlet name = node.nodeName;\n\n\t\t// Only one of these are ever allowed per document -- so, index is unnecessary\n\t\tif (name!==HTML_NODE_NAME && name!==BODY_NODE_NAME & name!==HEAD_NODE_NAME)\n\t\t{\n\t\t\tname += `:nth-child(${getNthIndex(node)})`;\n\t\t}\n\n\t\t// Building backwards\n\t\tselector.push(name);\n\n\t\tnode = node.parentNode;\n\t}\n\n\treturn selector.reverse().join(\" > \");\n};\n\n\n\n/**\n * Produces an `innerText` value for text nodes within an element.\n * @param {object} node\n * @returns {string|null}\n */\nconst getText = node =>\n{\n\tlet text = null;\n\n\tif (node.childNodes.length > 0)\n\t{\n\t\ttext = \"\";\n\n\t\twalk(node, ({nodeName, value}) =>\n\t\t{\n\t\t\tif (nodeName === TEXT_NODE_NAME)\n\t\t\t{\n\t\t\t\ttext += value;\n\t\t\t}\n\t\t});\n\n\t\t// @todo don't normalize if within 
 ? use \"normalize-html-whitespace\" package if so\n\t\ttext = condenseWhitespace(text);\n\t}\n\n\treturn text;\n};\n\n\n\n/**\n * Serialize an HTML element into a string.\n * @param {object} node\n * @returns {string}\n */\nconst stringifyNode = ({attrs, nodeName}) =>\n{\n\tconst attrsString = attrs.reduce((result, {name, value}) => `${result} ${name}=\"${value}\"`, \"\");\n\n\treturn `<${nodeName}${attrsString}>`;\n};\n\n\n\n/**\n * Scrape a parsed HTML document/tree for links.\n * @param {object} document\n * @param {URL|string} pageURL\n * @param {RobotDirectives} robots\n * @returns {Array}\n */\nexport default (document, pageURL, robots) =>\n{\n\tconst links = [];\n\tconst rootNode = findRootNode(document);\n\tconst {base} = findPreliminaries(rootNode, robots);\n\n\tfindLinks(rootNode, (node, attrName, url) =>\n\t{\n\t\t// Elements added for compliance (not from HTML source) have no location\n\t\tconst location = node.sourceCodeLocation?.attrs[attrName] ?? null;\n\n\t\tconst link = new Link()\n\t\t.set(HTML_ATTR_NAME, attrName)\n\t\t.set(HTML_ATTRS, node.attrMap)\n\t\t.set(HTML_BASE_HREF, base)\n\t\t.set(HTML_INDEX, links.length)\n\t\t.set(HTML_LOCATION, location)\n\t\t.set(HTML_SELECTOR, getSelector(node))\n\t\t.set(HTML_TAG, stringifyNode(node))\n\t\t.set(HTML_TAG_NAME, node.nodeName)\n\t\t.set(HTML_TEXT, getText(node))\n\t\t.resolve(url, pageURL);\n\n\t\tlinks.push(link);\n\t});\n\n\treturn links;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KA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AE/D,IAAI,CAACW,OAAO,CAAC,CAC7BtC,GAAG,CAAC2F,oBAAc,EAAErC,IAAI,CAAC,CACzBtD,GAAG,CAAC4F,gBAAU,EAAET,KAAK,CAAC/E,MAAM,CAAC,CAC7BJ,GAAG,CAAC6F,mBAAa,EAAER,QAAQ,CAAC,CAC5BrF,GAAG,CAAC8F,mBAAa,EAAExB,WAAW,CAAC3C,IAAI,CAAC,CAAC,CACrC3B,GAAG,CAAC+F,cAAQ,EAAEjB,aAAa,CAACnD,IAAI,CAAC,CAAC,CAClC3B,GAAG,CAACgG,mBAAa,EAAErE,IAAI,CAACC,QAAQ,CAAC,CACjC5B,GAAG,CAACiG,eAAS,EAAEtB,OAAO,CAAChD,IAAI,CAAC,CAAC,CAC7BuE,OAAO,CAAC9D,GAAG,EAAE8C,OAAO,CAAC;IAEtBC,KAAK,CAACX,IAAI,CAACe,IAAI,CAAC;EACjB,CAAC,CAAC;EAEF,OAAOJ,KAAK;AACb,CAAC;AAAAgB,OAAA,CAAAjH,OAAA,GAAA+F,QAAA;AAAAmB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjH,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/streamHTML.js b/lib-cjs/internal/streamHTML.js
new file mode 100644
index 00000000..c0ca4c8c
--- /dev/null
+++ b/lib-cjs/internal/streamHTML.js
@@ -0,0 +1,40 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _reasons = require("./reasons");
+var _httpProtocol = require("./http-protocol");
+var _isurl = _interopRequireDefault(require("isurl"));
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+//import {isCompatibleScheme as isFileScheme, streamHTML as streamHTMLFromFile} from "./file-protocol";
+/**
+ * Retreive HTML contents from a URL.
+ * @param {URL} url
+ * @param {object} auth
+ * @param {URLCache} cache
+ * @param {object} options
+ * @throws {ExpectedHTMLError} if not HTML media type
+ * @throws {HTMLRetrievalError} 404, etc
+ * @throws {TypeError} non-URL
+ * @returns {Promise}
+ */
+var _default = async (url, auth, cache, options) => {
+  if (!(0, _isurl.default)(url)) {
+    throw new TypeError(_reasons.BLC_INVALID);
+  } else {
+    /*if (isFileScheme(url))
+    {
+    	const stream = await streamHTMLFromFile(url);
+    	return {stream};
+    }
+    else if (isHTTPScheme(url))
+    {*/
+    return (0, _httpProtocol.streamHTML)(url, auth, cache, options);
+    //}
+  }
+};
+exports.default = _default;
+module.exports = exports.default;
+//# sourceMappingURL=streamHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/streamHTML.js.map b/lib-cjs/internal/streamHTML.js.map
new file mode 100644
index 00000000..74c6fbe7
--- /dev/null
+++ b/lib-cjs/internal/streamHTML.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"streamHTML.js","names":["_reasons","require","_httpProtocol","_isurl","_interopRequireDefault","obj","__esModule","default","_default","url","auth","cache","options","isURL","TypeError","BLC_INVALID","streamHTMLFromHTTP","exports","module"],"sources":["../../lib/internal/streamHTML.js"],"sourcesContent":["import {BLC_INVALID} from \"./reasons\";\n//import {isCompatibleScheme as isFileScheme, streamHTML as streamHTMLFromFile} from \"./file-protocol\";\nimport {/*isCompatibleScheme as isHTTPScheme, */streamHTML as streamHTMLFromHTTP} from \"./http-protocol\";\nimport isURL from \"isurl\";\n\n\n\n/**\n * Retreive HTML contents from a URL.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {ExpectedHTMLError} if not HTML media type\n * @throws {HTMLRetrievalError} 404, etc\n * @throws {TypeError} non-URL\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\t/*if (isFileScheme(url))\n\t\t{\n\t\t\tconst stream = await streamHTMLFromFile(url);\n\t\t\treturn {stream};\n\t\t}\n\t\telse if (isHTTPScheme(url))\n\t\t{*/\n\t\t\treturn streamHTMLFromHTTP(url, auth, cache, options);\n\t\t//}\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0B,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF1B;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAG,QAAA,GAWe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,IAAI,CAAC,IAAAC,cAAK,EAACJ,GAAG,CAAC,EACf;IACC,MAAM,IAAIK,SAAS,CAACC,oBAAW,CAAC;EACjC,CAAC,MAED;IACC;AACF;AACA;AACA;AACA;AACA;AACA;IACG,OAAO,IAAAC,wBAAkB,EAACP,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;IACrD;EACD;AACD,CAAC;AAAAK,OAAA,CAAAV,OAAA,GAAAC,QAAA;AAAAU,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAV,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/tags.js b/lib-cjs/internal/tags.js
new file mode 100644
index 00000000..b20219d5
--- /dev/null
+++ b/lib-cjs/internal/tags.js
@@ -0,0 +1,221 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _deepFreezeNode = _interopRequireDefault(require("deep-freeze-node"));
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+// Clickable links
+const flatLevel0 = {
+  a: {
+    href: true
+  },
+  area: {
+    href: true
+  }
+};
+
+// Clickable links, media, frames, meta refreshes
+const flatLevel1 = {
+  ...flatLevel0,
+  applet: {
+    archive: true,
+    code: true,
+    src: true
+  },
+  audio: {
+    src: true
+  },
+  body: {
+    background: true
+  },
+  embed: {
+    src: true
+  },
+  frame: {
+    src: true
+  },
+  iframe: {
+    src: true
+  },
+  img: {
+    src: true,
+    srcset: true
+  },
+  input: {
+    src: true
+  },
+  menuitem: {
+    icon: true
+  },
+  meta: {
+    content: true
+  },
+  object: {
+    data: true
+  },
+  source: {
+    src: true,
+    srcset: true
+  },
+  table: {
+    background: true
+  },
+  tbody: {
+    background: true
+  },
+  td: {
+    background: true
+  },
+  tfoot: {
+    background: true
+  },
+  th: {
+    background: true
+  },
+  thead: {
+    background: true
+  },
+  tr: {
+    background: true
+  },
+  track: {
+    src: true
+  },
+  video: {
+    poster: true,
+    src: true
+  }
+};
+
+// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms
+const flatLevel2 = {
+  ...flatLevel1,
+  button: {
+    formaction: true
+  },
+  form: {
+    action: true
+  },
+  input: {
+    formaction: true,
+    ...flatLevel1.input
+  },
+  link: {
+    href: true
+  },
+  script: {
+    src: true
+  }
+};
+
+// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms, metadata
+const flatLevel3 = {
+  ...flatLevel2,
+  "*": {
+    itemtype: true
+  },
+  a: {
+    ping: true,
+    ...flatLevel2.a
+  },
+  applet: {
+    codebase: true,
+    object: true,
+    ...flatLevel2.applet
+  },
+  area: {
+    ping: true,
+    ...flatLevel2.area
+  },
+  blockquote: {
+    cite: true
+  },
+  del: {
+    cite: true
+  },
+  frame: {
+    longdesc: true,
+    ...flatLevel2.frame
+  },
+  head: {
+    profile: true
+  },
+  html: {
+    manifest: true
+  },
+  iframe: {
+    longdesc: true,
+    ...flatLevel2.iframe
+  },
+  img: {
+    longdesc: true,
+    ...flatLevel2.img
+  },
+  ins: {
+    cite: true
+  },
+  object: {
+    codebase: true,
+    ...flatLevel2.object
+  },
+  q: {
+    cite: true
+  }
+};
+const recursiveLevel0 = flatLevel0;
+const recursiveLevel1 = {
+  ...recursiveLevel0,
+  iframe: {
+    src: true
+  },
+  meta: {
+    content: true
+  }
+};
+const recursiveLevel2 = recursiveLevel1;
+const recursiveLevel3 = {
+  ...recursiveLevel2,
+  blockquote: {
+    cite: true
+  },
+  del: {
+    cite: true
+  },
+  frame: {
+    longdesc: true
+  },
+  iframe: {
+    longdesc: true,
+    ...recursiveLevel2.iframe
+  },
+  img: {
+    longdesc: true
+  },
+  ins: {
+    cite: true
+  },
+  q: {
+    cite: true
+  }
+};
+var _default = exports.default = (0, _deepFreezeNode.default)({
+  0: flatLevel0,
+  1: flatLevel1,
+  2: flatLevel2,
+  3: flatLevel3,
+  length: 4,
+  // simulate Array
+
+  recursive:
+  // only used for `SiteChecker`
+  {
+    0: recursiveLevel0,
+    1: recursiveLevel1,
+    2: recursiveLevel2,
+    3: recursiveLevel3
+  }
+});
+module.exports = exports.default;
+//# sourceMappingURL=tags.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/tags.js.map b/lib-cjs/internal/tags.js.map
new file mode 100644
index 00000000..e6ed7673
--- /dev/null
+++ b/lib-cjs/internal/tags.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"tags.js","names":["_deepFreezeNode","_interopRequireDefault","require","obj","__esModule","default","flatLevel0","a","href","area","flatLevel1","applet","archive","code","src","audio","body","background","embed","frame","iframe","img","srcset","input","menuitem","icon","meta","content","object","data","source","table","tbody","td","tfoot","th","thead","tr","track","video","poster","flatLevel2","button","formaction","form","action","link","script","flatLevel3","itemtype","ping","codebase","blockquote","cite","del","longdesc","head","profile","html","manifest","ins","q","recursiveLevel0","recursiveLevel1","recursiveLevel2","recursiveLevel3","_default","exports","deepFreeze","length","recursive","module"],"sources":["../../lib/internal/tags.js"],"sourcesContent":["import deepFreeze from \"deep-freeze-node\";\n\n\n\n// Clickable links\nconst flatLevel0 =\n{\n\ta:      { href:true },\n\tarea:   { href:true }\n};\n\n// Clickable links, media, frames, meta refreshes\nconst flatLevel1 =\n{\n\t...flatLevel0,\n\tapplet:   { archive:true, code:true, src:true },\n\taudio:    { src:true },\n\tbody:     { background:true },\n\tembed:    { src:true },\n\tframe:    { src:true },\n\tiframe:   { src:true },\n\timg:      { src:true, srcset:true },\n\tinput:    { src:true },\n\tmenuitem: { icon:true },\n\tmeta:     { content:true },\n\tobject:   { data:true },\n\tsource:   { src:true, srcset:true },\n\ttable:    { background:true },\n\ttbody:    { background:true },\n\ttd:       { background:true },\n\ttfoot:    { background:true },\n\tth:       { background:true },\n\tthead:    { background:true },\n\ttr:       { background:true },\n\ttrack:    { src:true },\n\tvideo:    { poster:true, src:true }\n};\n\n// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms\nconst flatLevel2 =\n{\n\t...flatLevel1,\n\tbutton: { formaction:true },\n\tform:   { action:true },\n\tinput:  { formaction:true, ...flatLevel1.input },\n\tlink:   { href:true },\n\tscript: { src:true }\n};\n\n// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms, metadata\nconst flatLevel3 =\n{\n\t...flatLevel2,\n\t\"*\":        { itemtype:true },\n\ta:          { ping:true, ...flatLevel2.a },\n\tapplet:     { codebase:true, object:true, ...flatLevel2.applet },\n\tarea:       { ping:true, ...flatLevel2.area },\n\tblockquote: { cite:true },\n\tdel:        { cite:true },\n\tframe:      { longdesc:true, ...flatLevel2.frame },\n\thead:       { profile:true },\n\thtml:       { manifest:true },\n\tiframe:     { longdesc:true, ...flatLevel2.iframe },\n\timg:        { longdesc:true, ...flatLevel2.img },\n\tins:        { cite:true },\n\tobject:     { codebase:true, ...flatLevel2.object },\n\tq:          { cite:true }\n};\n\n\n\nconst recursiveLevel0 = flatLevel0;\n\nconst recursiveLevel1 =\n{\n\t...recursiveLevel0,\n\tiframe: { src:true },\n\tmeta:   { content:true }\n};\n\nconst recursiveLevel2 = recursiveLevel1;\n\nconst recursiveLevel3 =\n{\n\t...recursiveLevel2,\n\tblockquote: { cite:true },\n\tdel:        { cite:true },\n\tframe:      { longdesc:true },\n\tiframe:     { longdesc:true, ...recursiveLevel2.iframe },\n\timg:        { longdesc:true },\n\tins:        { cite:true },\n\tq:          { cite:true }\n};\n\n\n\nexport default deepFreeze(\n{\n\t0: flatLevel0,\n\t1: flatLevel1,\n\t2: flatLevel2,\n\t3: flatLevel3,\n\tlength: 4,  // simulate Array\n\n\trecursive:  // only used for `SiteChecker`\n\t{\n\t\t0: recursiveLevel0,\n\t\t1: recursiveLevel1,\n\t\t2: recursiveLevel2,\n\t\t3: recursiveLevel3\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1C;AACA,MAAMG,UAAU,GAChB;EACCC,CAAC,EAAO;IAAEC,IAAI,EAAC;EAAK,CAAC;EACrBC,IAAI,EAAI;IAAED,IAAI,EAAC;EAAK;AACrB,CAAC;;AAED;AACA,MAAME,UAAU,GAChB;EACC,GAAGJ,UAAU;EACbK,MAAM,EAAI;IAAEC,OAAO,EAAC,IAAI;IAAEC,IAAI,EAAC,IAAI;IAAEC,GAAG,EAAC;EAAK,CAAC;EAC/CC,KAAK,EAAK;IAAED,GAAG,EAAC;EAAK,CAAC;EACtBE,IAAI,EAAM;IAAEC,UAAU,EAAC;EAAK,CAAC;EAC7BC,KAAK,EAAK;IAAEJ,GAAG,EAAC;EAAK,CAAC;EACtBK,KAAK,EAAK;IAAEL,GAAG,EAAC;EAAK,CAAC;EACtBM,MAAM,EAAI;IAAEN,GAAG,EAAC;EAAK,CAAC;EACtBO,GAAG,EAAO;IAAEP,GAAG,EAAC,IAAI;IAAEQ,MAAM,EAAC;EAAK,CAAC;EACnCC,KAAK,EAAK;IAAET,GAAG,EAAC;EAAK,CAAC;EACtBU,QAAQ,EAAE;IAAEC,IAAI,EAAC;EAAK,CAAC;EACvBC,IAAI,EAAM;IAAEC,OAAO,EAAC;EAAK,CAAC;EAC1BC,MAAM,EAAI;IAAEC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Q,EAAC,IAAI;IAAE,GAAGS,eAAe,CAAC5C;EAAO,CAAC;EACxDC,GAAG,EAAS;IAAEkC,QAAQ,EAAC;EAAK,CAAC;EAC7BK,GAAG,EAAS;IAAEP,IAAI,EAAC;EAAK,CAAC;EACzBQ,CAAC,EAAW;IAAER,IAAI,EAAC;EAAK;AACzB,CAAC;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAIa,IAAA+D,uBAAU,EACzB;EACC,CAAC,EAAE9D,UAAU;EACb,CAAC,EAAEI,UAAU;EACb,CAAC,EAAE+B,UAAU;EACb,CAAC,EAAEO,UAAU;EACbqB,MAAM,EAAE,CAAC;EAAG;;EAEZC,SAAS;EAAG;EACZ;IACC,CAAC,EAAER,eAAe;IAClB,CAAC,EAAEC,eAAe;IAClB,CAAC,EAAEC,eAAe;IAClB,CAAC,EAAEC;EACJ;AACD,CAAC,CAAC;AAAAM,MAAA,CAAAJ,OAAA,GAAAA,OAAA,CAAA9D,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlChecker.js b/lib-cjs/public/HtmlChecker.js
new file mode 100644
index 00000000..7b456eca
--- /dev/null
+++ b/lib-cjs/public/HtmlChecker.js
@@ -0,0 +1,229 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _events = require("../internal/events");
+var _Link = require("../internal/Link");
+var _linkTypes = require("link-types");
+var _parseHTML = _interopRequireDefault(require("../internal/parseHTML"));
+var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
+var _robotDirectives = _interopRequireWildcard(require("robot-directives"));
+var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
+var _scrapeHTML = _interopRequireDefault(require("../internal/scrapeHTML"));
+var _httpProtocol = require("../internal/http-protocol");
+var _UrlChecker = _interopRequireDefault(require("./UrlChecker"));
+function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
+function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
+function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
+function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
+function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
+function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
+function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
+function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
+function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
+function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
+var _auth = /*#__PURE__*/new WeakMap();
+var _excludedLinks = /*#__PURE__*/new WeakMap();
+var _options = /*#__PURE__*/new WeakMap();
+var _resolvePromise = /*#__PURE__*/new WeakMap();
+var _robots = /*#__PURE__*/new WeakMap();
+var _scanning = /*#__PURE__*/new WeakMap();
+var _urlChecker = /*#__PURE__*/new WeakMap();
+var _complete = /*#__PURE__*/new WeakSet();
+var _getExcludeReason = /*#__PURE__*/new WeakSet();
+var _isExcludedAttribute = /*#__PURE__*/new WeakSet();
+var _maybeEnqueueLink = /*#__PURE__*/new WeakSet();
+var _reset = /*#__PURE__*/new WeakSet();
+class HtmlChecker extends _SafeEventEmitter.default {
+  constructor(options) {
+    super();
+    _classPrivateMethodInitSpec(this, _reset);
+    /**
+     * Enqueue a Link if it is valid and passes filters.
+     * @param {Link} link
+     */
+    _classPrivateMethodInitSpec(this, _maybeEnqueueLink);
+    /**
+     * Determine whether a Link's HTML element and attribute would cause it to be excluded from checks.
+     * @param {string} attrName
+     * @param {Array} tagNames
+     * @returns {boolean}
+     */
+    _classPrivateMethodInitSpec(this, _isExcludedAttribute);
+    /**
+     * Determine whether a Link should be excluded from checks, and the reason for such.
+     * @param {Link} link
+     * @returns {string|undefined}
+     */
+    _classPrivateMethodInitSpec(this, _getExcludeReason);
+    _classPrivateMethodInitSpec(this, _complete);
+    _classPrivateFieldInitSpec(this, _auth, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _excludedLinks, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _options, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _resolvePromise, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _robots, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _scanning, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _urlChecker, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldSet(this, _options, (0, _parseOptions.default)(options));
+    _classPrivateMethodGet(this, _reset, _reset2).call(this);
+    _classPrivateFieldSet(this, _urlChecker, new _UrlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, result => {
+      var _this$excludedLinks, _this$excludedLinks2;
+      result.set(_Link.HTML_OFFSET_INDEX, (_classPrivateFieldSet(this, _excludedLinks, (_this$excludedLinks = _classPrivateFieldGet(this, _excludedLinks), _this$excludedLinks2 = _this$excludedLinks++, _this$excludedLinks)), _this$excludedLinks2));
+      this.emit(_events.JUNK_EVENT, result);
+    }).on(_events.LINK_EVENT, result => this.emit(_events.LINK_EVENT, result)).on(_events.END_EVENT, () => _classPrivateMethodGet(this, _complete, _complete2).call(this)));
+  }
+  clearCache() {
+    _classPrivateFieldGet(this, _urlChecker).clearCache();
+    return this;
+  }
+  get isPaused() {
+    return _classPrivateFieldGet(this, _urlChecker).isPaused;
+  }
+  get numActiveLinks() {
+    return _classPrivateFieldGet(this, _urlChecker).numActiveLinks;
+  }
+  get numQueuedLinks() {
+    return _classPrivateFieldGet(this, _urlChecker).numQueuedLinks;
+  }
+  pause() {
+    _classPrivateFieldGet(this, _urlChecker).pause();
+    return this;
+  }
+  resume() {
+    _classPrivateFieldGet(this, _urlChecker).resume();
+    return this;
+  }
+
+  // `robots` and `auth` are undocumented and for internal use only
+  async scan(html, baseURL, robots, auth) {
+    if (_classPrivateFieldGet(this, _scanning)) {
+      // @todo use custom error (for better tests and consumer debugging) ?
+      throw new Error("Scan already in progress");
+    } else {
+      // Prevent user error with missing undocumented arugment
+      if (!(robots instanceof _robotDirectives.default)) {
+        robots = new _robotDirectives.default({
+          userAgent: _classPrivateFieldGet(this, _options).userAgent
+        });
+      }
+      const transitive = (0, _httpProtocol.transitiveAuth)(baseURL, auth);
+      baseURL = transitive.url; // @todo remove hash (and store somewhere?)
+
+      _classPrivateFieldSet(this, _auth, transitive.auth);
+      _classPrivateFieldSet(this, _robots, robots);
+      _classPrivateFieldSet(this, _scanning, true);
+      const document = await (0, _parseHTML.default)(html);
+      const links = (0, _scrapeHTML.default)(document, baseURL, _classPrivateFieldGet(this, _robots)); // @todo add auth?
+
+      this.emit(_events.HTML_EVENT, document, _classPrivateFieldGet(this, _robots));
+      links.forEach(link => _classPrivateMethodGet(this, _maybeEnqueueLink, _maybeEnqueueLink2).call(this, link));
+      const resolveOnComplete = new Promise(resolve => _classPrivateFieldSet(this, _resolvePromise, resolve));
+
+      // If no links found or all links already checked
+      if (_classPrivateFieldGet(this, _urlChecker).numActiveLinks === 0 && _classPrivateFieldGet(this, _urlChecker).numQueuedLinks === 0) {
+        _classPrivateMethodGet(this, _complete, _complete2).call(this);
+      }
+      return resolveOnComplete;
+    }
+  }
+  get __cache() {
+    return _classPrivateFieldGet(this, _urlChecker).__cache;
+  }
+}
+
+//::: PRIVATE FUNCTIONS
+exports.default = HtmlChecker;
+function _complete2() {
+  const resolvePromise = _classPrivateFieldGet(this, _resolvePromise);
+  _classPrivateMethodGet(this, _reset, _reset2).call(this);
+  this.emit(_events.COMPLETE_EVENT);
+  resolvePromise();
+}
+function _getExcludeReason2(link) {
+  const attrName = link.get(_Link.HTML_ATTR_NAME);
+  const attrs = link.get(_Link.HTML_ATTRS);
+  const isInternal = link.get(_Link.IS_INTERNAL);
+  const tagName = link.get(_Link.HTML_TAG_NAME);
+  const {
+    excludeExternalLinks,
+    excludeInternalLinks,
+    excludeLinksToSamePage,
+    honorRobotExclusions
+  } = _classPrivateFieldGet(this, _options);
+  if (honorRobotExclusions && _classPrivateFieldGet(this, _robots).oneIs([_robotDirectives.NOFOLLOW, _robotDirectives.NOINDEX])) {
+    return "BLC_ROBOTS";
+  } else if (honorRobotExclusions && _classPrivateFieldGet(this, _robots).is(_robotDirectives.NOIMAGEINDEX) && isRobotAttr(tagName, attrName)) {
+    return "BLC_ROBOTS";
+  } else if (honorRobotExclusions && (attrs === null || attrs === void 0 ? void 0 : attrs.rel) != null && (0, _linkTypes.map)(attrs.rel).nofollow) {
+    return "BLC_ROBOTS";
+  } else if (_classPrivateMethodGet(this, _isExcludedAttribute, _isExcludedAttribute2).call(this, attrName, [tagName, "*"])) {
+    return "BLC_HTML";
+  } else if (excludeExternalLinks && isInternal === false) {
+    return "BLC_EXTERNAL";
+  } else if (excludeInternalLinks && isInternal) {
+    return "BLC_INTERNAL";
+  } else if (excludeLinksToSamePage && link.get(_Link.IS_SAME_PAGE)) {
+    return "BLC_SAMEPAGE";
+  }
+}
+function _isExcludedAttribute2(attrName, tagNames) {
+  const tagGroups = _classPrivateFieldGet(this, _options).tags[_classPrivateFieldGet(this, _options).filterLevel];
+  return tagNames.every(tagName => !(tagName in tagGroups) || !(attrName in tagGroups[tagName]));
+}
+function _maybeEnqueueLink2(link) {
+  if (link.get(_Link.REBASED_URL) === null) {
+    link.set(_Link.HTML_OFFSET_INDEX, link.get(_Link.HTML_INDEX) - _classPrivateFieldGet(this, _excludedLinks));
+    link.break("BLC_INVALID");
+
+    // Can't enqueue a non-URL
+    this.emit(_events.LINK_EVENT, link);
+  } else {
+    const excludedReason = _classPrivateMethodGet(this, _getExcludeReason, _getExcludeReason2).call(this, link);
+    if (excludedReason === undefined) {
+      link.set(_Link.HTML_OFFSET_INDEX, link.get(_Link.HTML_INDEX) - _classPrivateFieldGet(this, _excludedLinks));
+      _classPrivateFieldGet(this, _urlChecker).enqueue(link, null, _classPrivateFieldGet(this, _auth));
+    } else {
+      var _this$excludedLinks3, _this$excludedLinks4;
+      link.set(_Link.HTML_OFFSET_INDEX, (_classPrivateFieldSet(this, _excludedLinks, (_this$excludedLinks3 = _classPrivateFieldGet(this, _excludedLinks), _this$excludedLinks4 = _this$excludedLinks3++, _this$excludedLinks3)), _this$excludedLinks4));
+      link.exclude(excludedReason);
+      this.emit(_events.JUNK_EVENT, link);
+    }
+  }
+}
+function _reset2() {
+  _classPrivateFieldSet(this, _auth, null);
+  _classPrivateFieldSet(this, _excludedLinks, 0);
+  _classPrivateFieldSet(this, _resolvePromise, null);
+  _classPrivateFieldSet(this, _robots, null);
+  _classPrivateFieldSet(this, _scanning, false);
+}
+const isRobotAttr = (tagName, attrName) => {
+  return tagName === "img" && attrName === "src" || tagName === "input" && attrName === "src" || tagName === "menuitem" && attrName === "icon" || tagName === "video" && attrName === "poster";
+};
+module.exports = exports.default;
+//# sourceMappingURL=HtmlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlChecker.js.map b/lib-cjs/public/HtmlChecker.js.map
new file mode 100644
index 00000000..05fe1af8
--- /dev/null
+++ b/lib-cjs/public/HtmlChecker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"HtmlChecker.js","names":["_events","require","_Link","_linkTypes","_parseHTML","_interopRequireDefault","_parseOptions","_robotDirectives","_interopRequireWildcard","_SafeEventEmitter","_scrapeHTML","_httpProtocol","_UrlChecker","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateMethodGet","fn","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","_auth","_excludedLinks","_options","_resolvePromise","_robots","_scanning","_urlChecker","_complete","WeakSet","_getExcludeReason","_isExcludedAttribute","_maybeEnqueueLink","_reset","HtmlChecker","SafeEventEmitter","constructor","options","parseOptions","_reset2","UrlChecker","on","ERROR_EVENT","error","emit","QUEUE_EVENT","JUNK_EVENT","result","_this$excludedLinks","_this$excludedLinks2","HTML_OFFSET_INDEX","LINK_EVENT","END_EVENT","_complete2","clearCache","isPaused","numActiveLinks","numQueuedLinks","pause","resume","scan","html","baseURL","robots","auth","Error","RobotDirectives","userAgent","transitive","transitiveAuth","url","document","parseHTML","links","scrapeHTML","HTML_EVENT","forEach","link","_maybeEnqueueLink2","resolveOnComplete","Promise","resolve","__cache","exports","resolvePromise","COMPLETE_EVENT","_getExcludeReason2","attrName","HTML_ATTR_NAME","attrs","HTML_ATTRS","isInternal","IS_INTERNAL","tagName","HTML_TAG_NAME","excludeExternalLinks","excludeInternalLinks","excludeLinksToSamePage","honorRobotExclusions","oneIs","NOFOLLOW","NOINDEX","is","NOIMAGEINDEX","isRobotAttr","rel","linkTypes","nofollow","_isExcludedAttribute2","IS_SAME_PAGE","tagNames","tagGroups","tags","filterLevel","every","REBASED_URL","HTML_INDEX","break","excludedReason","undefined","enqueue","_this$excludedLinks3","_this$excludedLinks4","exclude","module"],"sources":["../../lib/public/HtmlChecker.js"],"sourcesContent":["import {COMPLETE_EVENT, END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport {HTML_ATTR_NAME, HTML_ATTRS, HTML_INDEX, HTML_OFFSET_INDEX, HTML_TAG_NAME, IS_INTERNAL, IS_SAME_PAGE, REBASED_URL} from \"../internal/Link\";\nimport {map as linkTypes} from \"link-types\";\nimport parseHTML from \"../internal/parseHTML\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RobotDirectives, {NOFOLLOW, NOIMAGEINDEX, NOINDEX} from \"robot-directives\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport scrapeHTML from \"../internal/scrapeHTML\";\nimport {transitiveAuth} from \"../internal/http-protocol\";\nimport UrlChecker from \"./UrlChecker\";\n\n\n\nexport default class HtmlChecker extends SafeEventEmitter\n{\n\t#auth;\n\t#excludedLinks;\n\t#options;\n\t#resolvePromise;\n\t#robots;\n\t#scanning;\n\t#urlChecker;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#options = parseOptions(options);\n\t\tthis.#reset();\n\n\t\tthis.#urlChecker = new UrlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, result =>\n\t\t{\n\t\t\tresult.set(HTML_OFFSET_INDEX, this.#excludedLinks++);\n\n\t\t\tthis.emit(JUNK_EVENT, result);\n\t\t})\n\t\t.on(LINK_EVENT, result => this.emit(LINK_EVENT, result))\n\t\t.on(END_EVENT, () => this.#complete());\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#urlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\t#complete()\n\t{\n\t\tconst resolvePromise = this.#resolvePromise;\n\n\t\tthis.#reset();\n\n\t\tthis.emit(COMPLETE_EVENT);\n\n\t\tresolvePromise();\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be excluded from checks, and the reason for such.\n\t * @param {Link} link\n\t * @returns {string|undefined}\n\t */\n\t#getExcludeReason(link)\n\t{\n\t\tconst attrName = link.get(HTML_ATTR_NAME);\n\t\tconst attrs = link.get(HTML_ATTRS);\n\t\tconst isInternal = link.get(IS_INTERNAL);\n\t\tconst tagName = link.get(HTML_TAG_NAME);\n\n\t\tconst\n\t\t{\n\t\t\texcludeExternalLinks,\n\t\t\texcludeInternalLinks,\n\t\t\texcludeLinksToSamePage,\n\t\t\thonorRobotExclusions\n\t\t} = this.#options;\n\n\t\tif (honorRobotExclusions && this.#robots.oneIs([ NOFOLLOW, NOINDEX ]))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (honorRobotExclusions && this.#robots.is(NOIMAGEINDEX) && isRobotAttr(tagName, attrName))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (honorRobotExclusions && attrs?.rel!=null && linkTypes(attrs.rel).nofollow)\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (this.#isExcludedAttribute(attrName, [tagName, \"*\"]))\n\t\t{\n\t\t\treturn \"BLC_HTML\";\n\t\t}\n\t\telse if (excludeExternalLinks && isInternal===false)\n\t\t{\n\t\t\treturn \"BLC_EXTERNAL\";\n\t\t}\n\t\telse if (excludeInternalLinks && isInternal)\n\t\t{\n\t\t\treturn \"BLC_INTERNAL\";\n\t\t}\n\t\telse if (excludeLinksToSamePage && link.get(IS_SAME_PAGE))\n\t\t{\n\t\t\treturn \"BLC_SAMEPAGE\";\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link's HTML element and attribute would cause it to be excluded from checks.\n\t * @param {string} attrName\n\t * @param {Array} tagNames\n\t * @returns {boolean}\n\t */\n\t#isExcludedAttribute(attrName, tagNames)\n\t{\n\t\tconst tagGroups = this.#options.tags[this.#options.filterLevel];\n\n\t\treturn tagNames.every(tagName => !(tagName in tagGroups) || !(attrName in tagGroups[tagName]));\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#urlChecker.isPaused;\n\t}\n\n\n\n\t/**\n\t * Enqueue a Link if it is valid and passes filters.\n\t * @param {Link} link\n\t */\n\t#maybeEnqueueLink(link)\n\t{\n\t\tif (link.get(REBASED_URL) === null)\n\t\t{\n\t\t\tlink.set(HTML_OFFSET_INDEX, link.get(HTML_INDEX) - this.#excludedLinks);\n\t\t\tlink.break(\"BLC_INVALID\");\n\n\t\t\t// Can't enqueue a non-URL\n\t\t\tthis.emit(LINK_EVENT, link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst excludedReason = this.#getExcludeReason(link);\n\n\t\t\tif (excludedReason === undefined)\n\t\t\t{\n\t\t\t\tlink.set(HTML_OFFSET_INDEX, link.get(HTML_INDEX) - this.#excludedLinks);\n\n\t\t\t\tthis.#urlChecker.enqueue(link, null, this.#auth);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlink.set(HTML_OFFSET_INDEX, this.#excludedLinks++);\n\t\t\t\tlink.exclude(excludedReason);\n\n\t\t\t\tthis.emit(JUNK_EVENT, link);\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#urlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#urlChecker.numQueuedLinks;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#urlChecker.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#auth = null;\n\t\tthis.#excludedLinks = 0;\n\t\tthis.#resolvePromise = null;\n\t\tthis.#robots = null;\n\t\tthis.#scanning = false;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#urlChecker.resume();\n\t\treturn this;\n\t}\n\n\n\n\t// `robots` and `auth` are undocumented and for internal use only\n\tasync scan(html, baseURL, robots, auth)\n\t{\n\t\tif (this.#scanning)\n\t\t{\n\t\t\t// @todo use custom error (for better tests and consumer debugging) ?\n\t\t\tthrow new Error(\"Scan already in progress\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Prevent user error with missing undocumented arugment\n\t\t\tif (!(robots instanceof RobotDirectives))\n\t\t\t{\n\t\t\t\trobots = new RobotDirectives({ userAgent: this.#options.userAgent });\n\t\t\t}\n\n\t\t\tconst transitive = transitiveAuth(baseURL, auth);\n\n\t\t\tbaseURL = transitive.url;  // @todo remove hash (and store somewhere?)\n\n\t\t\tthis.#auth = transitive.auth;\n\t\t\tthis.#robots = robots;\n\t\t\tthis.#scanning = true;\n\n\t\t\tconst document = await parseHTML(html);\n\t\t\tconst links = scrapeHTML(document, baseURL, this.#robots);  // @todo add auth?\n\n\t\t\tthis.emit(HTML_EVENT, document, this.#robots);\n\n\t\t\tlinks.forEach(link => this.#maybeEnqueueLink(link));\n\n\t\t\tconst resolveOnComplete = new Promise(resolve => this.#resolvePromise = resolve);\n\n\t\t\t// If no links found or all links already checked\n\t\t\tif (this.#urlChecker.numActiveLinks===0 && this.#urlChecker.numQueuedLinks===0)\n\t\t\t{\n\t\t\t\tthis.#complete();\n\t\t\t}\n\n\t\t\treturn resolveOnComplete;\n\t\t}\n\t}\n\n\n\n\tget __cache()\n\t{\n\t\treturn this.#urlChecker.__cache;\n\t}\n}\n\n\n\n//::: PRIVATE FUNCTIONS\n\n\n\nconst isRobotAttr = (tagName, attrName) =>\n{\n\treturn (tagName===\"img\"      && attrName===\"src\"   ) ||\n\t       (tagName===\"input\"    && attrName===\"src\"   ) ||\n\t       (tagName===\"menuitem\" && attrName===\"icon\"  ) ||\n\t       (tagName===\"video\"    && attrName===\"poster\");\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,gBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,WAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAP,sBAAA,CAAAJ,OAAA;AAAsC,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CA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A,EAAS,IAAI;EACjBJ,qBAAA,KAAI,EAAAK,cAAA,EAAkB,CAAC;EACvBL,qBAAA,KAAI,EAAAO,eAAA,EAAmB,IAAI;EAC3BP,qBAAA,KAAI,EAAAQ,OAAA,EAAW,IAAI;EACnBR,qBAAA,KAAI,EAAAS,SAAA,EAAa,KAAK;AACvB;AAqED,MAAM8E,WAAW,GAAGA,CAACX,OAAO,EAAEN,QAAQ,KACtC;EACC,OAAQM,OAAO,KAAG,KAAK,IAASN,QAAQ,KAAG,KAAK,IACxCM,OAAO,KAAG,OAAO,IAAON,QAAQ,KAAG,KAAS,IAC5CM,OAAO,KAAG,UAAU,IAAIN,QAAQ,KAAG,MAAS,IAC5CM,OAAO,KAAG,OAAO,IAAON,QAAQ,KAAG,QAAS;AACrD,CAAC;AAACqC,MAAA,CAAAzC,OAAA,GAAAA,OAAA,CAAAlG,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlUrlChecker.js b/lib-cjs/public/HtmlUrlChecker.js
new file mode 100644
index 00000000..f3747c84
--- /dev/null
+++ b/lib-cjs/public/HtmlUrlChecker.js
@@ -0,0 +1,212 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _events = require("../internal/events");
+var _HtmlChecker = _interopRequireDefault(require("./HtmlChecker"));
+var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
+var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
+var _robotDirectives = _interopRequireDefault(require("robot-directives"));
+var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
+var _streamHTML = _interopRequireDefault(require("../internal/streamHTML"));
+var _httpProtocol = require("../internal/http-protocol");
+function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
+function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
+function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
+function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
+function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
+function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
+function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
+function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
+function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
+function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
+var _currentAuth = /*#__PURE__*/new WeakMap();
+var _currentCustomData = /*#__PURE__*/new WeakMap();
+var _currentDone = /*#__PURE__*/new WeakMap();
+var _currentPageURL = /*#__PURE__*/new WeakMap();
+var _currentResponse = /*#__PURE__*/new WeakMap();
+var _currentRobots = /*#__PURE__*/new WeakMap();
+var _htmlChecker = /*#__PURE__*/new WeakMap();
+var _htmlUrlQueue = /*#__PURE__*/new WeakMap();
+var _options = /*#__PURE__*/new WeakMap();
+var _appendRobotHeaders = /*#__PURE__*/new WeakSet();
+var _completedPage = /*#__PURE__*/new WeakSet();
+var _reset = /*#__PURE__*/new WeakSet();
+class HtmlUrlChecker extends _SafeEventEmitter.default {
+  constructor(options) {
+    super();
+    _classPrivateMethodInitSpec(this, _reset);
+    /**
+     * Emit PAGE_EVENT and continue the queue.
+     * @param {Error} [error]
+     */
+    _classPrivateMethodInitSpec(this, _completedPage);
+    /**
+     * Append any robot headers.
+     */
+    _classPrivateMethodInitSpec(this, _appendRobotHeaders);
+    _classPrivateFieldInitSpec(this, _currentAuth, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentCustomData, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentDone, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentPageURL, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentResponse, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentRobots, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _htmlChecker, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _htmlUrlQueue, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _options, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateMethodGet(this, _reset, _reset2).call(this);
+    _classPrivateFieldSet(this, _options, (0, _parseOptions.default)(options));
+    _classPrivateFieldSet(this, _htmlUrlQueue, new _limitedRequestQueue.default({
+      maxSockets: 1,
+      rateLimit: _classPrivateFieldGet(this, _options).rateLimit
+    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
+      auth,
+      customData
+    }, done) => {
+      _classPrivateMethodGet(this, _reset, _reset2).call(this);
+      _classPrivateFieldSet(this, _currentAuth, auth);
+      _classPrivateFieldSet(this, _currentCustomData, customData);
+      _classPrivateFieldSet(this, _currentDone, done);
+      _classPrivateFieldSet(this, _currentPageURL, url); // @todo remove hash ?
+
+      try {
+        const {
+          response,
+          stream
+        } = await (0, _streamHTML.default)(_classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentAuth), this.__cache, _classPrivateFieldGet(this, _options));
+
+        // Is only defined for HTTP -- made null for consistency
+        _classPrivateFieldSet(this, _currentResponse, response ?? null);
+        _classPrivateFieldSet(this, _currentRobots, new _robotDirectives.default({
+          userAgent: _classPrivateFieldGet(this, _options).userAgent
+        }));
+        _classPrivateMethodGet(this, _appendRobotHeaders, _appendRobotHeaders2).call(this);
+
+        // If redirected for HTTP, or original URL for non-HTTP
+        const finalPageURL = (response === null || response === void 0 ? void 0 : response.url) ?? _classPrivateFieldGet(this, _currentPageURL);
+
+        // Passes robots instance so that headers are included in robot exclusion checks
+        // @todo does the `await` cause `completedPage` to be called twice (other's in COMPLETE_EVENT) if error occurs?
+        await _classPrivateFieldGet(this, _htmlChecker).scan(stream, finalPageURL, _classPrivateFieldGet(this, _currentRobots), _classPrivateFieldGet(this, _currentAuth));
+      } catch (error) {
+        _classPrivateMethodGet(this, _completedPage, _completedPage2).call(this, error);
+      }
+    }).on(_limitedRequestQueue.END_EVENT, () => {
+      // Clear references for garbage collection
+      _classPrivateMethodGet(this, _reset, _reset2).call(this);
+      this.emit(_events.END_EVENT);
+    }));
+    _classPrivateFieldSet(this, _htmlChecker, new _HtmlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.HTML_EVENT, (tree, robots) => {
+      this.emit(_events.HTML_EVENT, tree, robots, _classPrivateFieldGet(this, _currentResponse), _classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentCustomData));
+    }).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, result => this.emit(_events.JUNK_EVENT, result, _classPrivateFieldGet(this, _currentCustomData))).on(_events.LINK_EVENT, result => this.emit(_events.LINK_EVENT, result, _classPrivateFieldGet(this, _currentCustomData))).on(_events.COMPLETE_EVENT, () => _classPrivateMethodGet(this, _completedPage, _completedPage2).call(this)));
+  }
+  clearCache() {
+    _classPrivateFieldGet(this, _htmlChecker).clearCache();
+    return this;
+  }
+  dequeue(id) {
+    const success = _classPrivateFieldGet(this, _htmlUrlQueue).dequeue(id);
+    this.emit(_events.QUEUE_EVENT);
+    return success;
+  }
+
+  // `auth` is undocumented and for internal use only
+  enqueue(pageURL, customData, auth) {
+    // @todo this could get messy if there're many different credentials per site (if we cache based on headers)
+    const transitive = (0, _httpProtocol.transitiveAuth)(pageURL, auth);
+    const id = _classPrivateFieldGet(this, _htmlUrlQueue).enqueue(transitive.url, {
+      auth: transitive.auth,
+      customData
+    });
+    this.emit(_events.QUEUE_EVENT);
+    return id;
+  }
+  has(id) {
+    return _classPrivateFieldGet(this, _htmlUrlQueue).has(id);
+  }
+  get isPaused() {
+    return _classPrivateFieldGet(this, _htmlChecker).isPaused;
+  }
+  get numActiveLinks() {
+    return _classPrivateFieldGet(this, _htmlChecker).numActiveLinks;
+  }
+  get numPages() {
+    return _classPrivateFieldGet(this, _htmlUrlQueue).length;
+  }
+  get numQueuedLinks() {
+    return _classPrivateFieldGet(this, _htmlChecker).numQueuedLinks;
+  }
+  pause() {
+    _classPrivateFieldGet(this, _htmlChecker).pause();
+    _classPrivateFieldGet(this, _htmlUrlQueue).pause();
+    return this;
+  }
+  resume() {
+    _classPrivateFieldGet(this, _htmlChecker).resume();
+    _classPrivateFieldGet(this, _htmlUrlQueue).resume();
+    return this;
+  }
+  get __cache() {
+    return _classPrivateFieldGet(this, _htmlChecker).__cache;
+  }
+}
+exports.default = HtmlUrlChecker;
+function _appendRobotHeaders2() {
+  var _classPrivateFieldGet2;
+  const xRobotsTag = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _currentResponse)) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.headers["x-robots-tag"];
+
+  // @todo https://github.com/nodejs/node/issues/3591
+  if (xRobotsTag != null) {
+    _classPrivateFieldGet(this, _currentRobots).header(xRobotsTag);
+  }
+}
+function _completedPage2(error = null) {
+  // @todo emit page error instead?
+  // @todo include redirected url if there is one?
+  this.emit(_events.PAGE_EVENT, error, _classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentCustomData));
+
+  // Auto-starts next queue item, if any
+  // Emits REQUEST_QUEUE_END_EVENT, if not
+  _classPrivateFieldGet(this, _currentDone).call(this);
+}
+function _reset2() {
+  _classPrivateFieldSet(this, _currentAuth, null);
+  _classPrivateFieldSet(this, _currentCustomData, null);
+  _classPrivateFieldSet(this, _currentDone, null);
+  _classPrivateFieldSet(this, _currentPageURL, null);
+  _classPrivateFieldSet(this, _currentResponse, null);
+  _classPrivateFieldSet(this, _currentRobots, null);
+}
+module.exports = exports.default;
+//# sourceMappingURL=HtmlUrlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlUrlChecker.js.map b/lib-cjs/public/HtmlUrlChecker.js.map
new file mode 100644
index 00000000..f497cab6
--- /dev/null
+++ b/lib-cjs/public/HtmlUrlChecker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"HtmlUrlChecker.js","names":["_events","require","_HtmlChecker","_interopRequireDefault","_parseOptions","_limitedRequestQueue","_interopRequireWildcard","_robotDirectives","_SafeEventEmitter","_streamHTML","_httpProtocol","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","_classPrivateMethodGet","fn","_currentAuth","_currentCustomData","_currentDone","_currentPageURL","_currentResponse","_currentRobots","_htmlChecker","_htmlUrlQueue","_options","_appendRobotHeaders","WeakSet","_completedPage","_reset","HtmlUrlChecker","SafeEventEmitter","constructor","options","_reset2","parseOptions","RequestQueue","maxSockets","rateLimit","on","ITEM_EVENT","url","auth","customData","done","response","stream","streamHTML","__cache","RobotDirectives","userAgent","_appendRobotHeaders2","finalPageURL","scan","error","_completedPage2","REQUEST_QUEUE_END_EVENT","emit","END_EVENT","HtmlChecker","ERROR_EVENT","HTML_EVENT","tree","robots","QUEUE_EVENT","JUNK_EVENT","result","LINK_EVENT","COMPLETE_EVENT","clearCache","dequeue","id","success","enqueue","pageURL","transitive","transitiveAuth","isPaused","numActiveLinks","numPages","length","numQueuedLinks","pause","resume","exports","_classPrivateFieldGet2","xRobotsTag","headers","header","PAGE_EVENT","module"],"sources":["../../lib/public/HtmlUrlChecker.js"],"sourcesContent":["import {COMPLETE_EVENT, END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport HtmlChecker from \"./HtmlChecker\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport RobotDirectives from \"robot-directives\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport streamHTML from \"../internal/streamHTML\";\nimport {transitiveAuth} from \"../internal/http-protocol\";\n\n\n\nexport default class HtmlUrlChecker extends SafeEventEmitter\n{\n\t#currentAuth;\n\t#currentCustomData;\n\t#currentDone;\n\t#currentPageURL;\n\t#currentResponse;\n\t#currentRobots;\n\t#htmlChecker;\n\t#htmlUrlQueue;\n\t#options;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#reset();\n\n\t\tthis.#options = parseOptions(options);\n\n\t\tthis.#htmlUrlQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets: 1,\n\t\t\trateLimit: this.#options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData}, done) =>\n\t\t{\n\t\t\tthis.#reset();\n\n\t\t\tthis.#currentAuth = auth;\n\t\t\tthis.#currentCustomData = customData;\n\t\t\tthis.#currentDone = done;\n\t\t\tthis.#currentPageURL = url;  // @todo remove hash ?\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst {response, stream} = await streamHTML(this.#currentPageURL, this.#currentAuth, this.__cache, this.#options);\n\n\t\t\t\t// Is only defined for HTTP -- made null for consistency\n\t\t\t\tthis.#currentResponse = response ?? null;\n\n\t\t\t\tthis.#currentRobots = new RobotDirectives({ userAgent: this.#options.userAgent });\n\n\t\t\t\tthis.#appendRobotHeaders();\n\n\t\t\t\t// If redirected for HTTP, or original URL for non-HTTP\n\t\t\t\tconst finalPageURL = response?.url ?? this.#currentPageURL;\n\n\t\t\t\t// Passes robots instance so that headers are included in robot exclusion checks\n\t\t\t\t// @todo does the `await` cause `completedPage` to be called twice (other's in COMPLETE_EVENT) if error occurs?\n\t\t\t\tawait this.#htmlChecker.scan(stream, finalPageURL, this.#currentRobots, this.#currentAuth);\n\t\t\t}\n\t\t\tcatch (error)\n\t\t\t{\n\t\t\t\tthis.#completedPage(error);\n\t\t\t}\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () =>\n\t\t{\n\t\t\t// Clear references for garbage collection\n\t\t\tthis.#reset();\n\n\t\t\tthis.emit(END_EVENT);\n\t\t});\n\n\t\tthis.#htmlChecker = new HtmlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(HTML_EVENT, (tree, robots) =>\n\t\t{\n\t\t\tthis.emit(HTML_EVENT, tree, robots, this.#currentResponse, this.#currentPageURL, this.#currentCustomData);\n\t\t})\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, result => this.emit(JUNK_EVENT, result, this.#currentCustomData))\n\t\t.on(LINK_EVENT, result => this.emit(LINK_EVENT, result, this.#currentCustomData))\n\t\t.on(COMPLETE_EVENT, () => this.#completedPage());\n\t}\n\n\n\n\t/**\n\t * Append any robot headers.\n\t */\n\t#appendRobotHeaders()\n\t{\n\t\tconst xRobotsTag = this.#currentResponse?.headers[\"x-robots-tag\"];\n\n\t\t// @todo https://github.com/nodejs/node/issues/3591\n\t\tif (xRobotsTag != null)\n\t\t{\n\t\t\tthis.#currentRobots.header(xRobotsTag);\n\t\t}\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#htmlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Emit PAGE_EVENT and continue the queue.\n\t * @param {Error} [error]\n\t */\n\t#completedPage(error = null)\n\t{\n\t\t// @todo emit page error instead?\n\t\t// @todo include redirected url if there is one?\n\t\tthis.emit(PAGE_EVENT, error, this.#currentPageURL, this.#currentCustomData);\n\n\t\t// Auto-starts next queue item, if any\n\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\tthis.#currentDone();\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#htmlUrlQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t// `auth` is undocumented and for internal use only\n\tenqueue(pageURL, customData, auth)\n\t{\n\t\t// @todo this could get messy if there're many different credentials per site (if we cache based on headers)\n\t\tconst transitive = transitiveAuth(pageURL, auth);\n\n\t\tconst id = this.#htmlUrlQueue.enqueue(transitive.url, { auth:transitive.auth, customData });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn id;\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#htmlUrlQueue.has(id);\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#htmlChecker.isPaused;\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#htmlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numPages()\n\t{\n\t\treturn this.#htmlUrlQueue.length;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#htmlChecker.numQueuedLinks;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#htmlChecker.pause();\n\t\tthis.#htmlUrlQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#currentAuth = null;\n\t\tthis.#currentCustomData = null;\n\t\tthis.#currentDone = null;\n\t\tthis.#currentPageURL = null;\n\t\tthis.#currentResponse = null;\n\t\tthis.#currentRobots = null;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#htmlChecker.resume();\n\t\tthis.#htmlUrlQueue.resume();\n\t\treturn this;\n\t}\n\n\n\n\tget __cache()\n\t{\n\t\treturn this.#htmlChecker.__cache;\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,iBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAAyD,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN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AE,IAAI,EAAAc,eAAA,GAAAd,qBAAA,CAAkB,IAAI,EAAAY,kBAAA,CAAmB,CAAC;;EAE3E;EACA;EACAZ,qBAAA,KAAI,EAAAa,YAAA,EAAA1B,IAAA,CAAJ,IAAI;AACL;AAAC,SAAAyC,QAAA,EA2ED;EACCvB,qBAAA,KAAI,EAAAM,YAAA,EAAgB,IAAI;EACxBN,qBAAA,KAAI,EAAAO,kBAAA,EAAsB,IAAI;EAC9BP,qBAAA,KAAI,EAAAQ,YAAA,EAAgB,IAAI;EACxBR,qBAAA,KAAI,EAAAS,eAAA,EAAmB,IAAI;EAC3BT,qBAAA,KAAI,EAAAU,gBAAA,EAAoB,IAAI;EAC5BV,qBAAA,KAAI,EAAAW,cAAA,EAAkB,IAAI;AAC3B;AAACoE,MAAA,CAAAN,OAAA,GAAAA,OAAA,CAAAvG,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/SiteChecker.js b/lib-cjs/public/SiteChecker.js
new file mode 100644
index 00000000..65cb45e1
--- /dev/null
+++ b/lib-cjs/public/SiteChecker.js
@@ -0,0 +1,319 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _events = require("../internal/events");
+var _Link = require("../internal/Link");
+var _httpProtocol = require("../internal/http-protocol");
+var _HtmlUrlChecker = _interopRequireDefault(require("./HtmlUrlChecker"));
+var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
+var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
+var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
+var _urlcache = _interopRequireDefault(require("urlcache"));
+function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
+function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
+function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
+function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
+function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
+function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
+function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
+function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
+function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
+function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
+// @todo BLC_ROBOTS catches rel=nofollow links but will also catch meta/header excluded links -- fine?
+const PAGE_EXCLUSIONS = ["BLC_KEYWORD", "BLC_ROBOTS"];
+const PAGE_WAS_CHECKED = true;
+var _currentAuth = /*#__PURE__*/new WeakMap();
+var _currentCustomData = /*#__PURE__*/new WeakMap();
+var _currentDone = /*#__PURE__*/new WeakMap();
+var _currentPageError = /*#__PURE__*/new WeakMap();
+var _currentRobotsTxt = /*#__PURE__*/new WeakMap();
+var _currentSiteURL = /*#__PURE__*/new WeakMap();
+var _htmlUrlChecker = /*#__PURE__*/new WeakMap();
+var _options = /*#__PURE__*/new WeakMap();
+var _sitePagesChecked = /*#__PURE__*/new WeakMap();
+var _siteUrlQueue = /*#__PURE__*/new WeakMap();
+var _enqueuePage = /*#__PURE__*/new WeakSet();
+var _getExcludedReason = /*#__PURE__*/new WeakSet();
+var _isAllowed = /*#__PURE__*/new WeakSet();
+var _maybeEnqueuePage = /*#__PURE__*/new WeakSet();
+var _overrideOptions = /*#__PURE__*/new WeakSet();
+var _reset = /*#__PURE__*/new WeakSet();
+class SiteChecker extends _SafeEventEmitter.default {
+  constructor(_options2) {
+    super();
+    _classPrivateMethodInitSpec(this, _reset);
+    /**
+     * Override/mutate some options for extended behavior.
+     * @param {object} options
+     * @returns {object}
+     */
+    _classPrivateMethodInitSpec(this, _overrideOptions);
+    /**
+     * Enqueue a page (to be crawled) if it passes filters.
+     * @param {Link} link
+     * @param {*} customData
+     * @param {object} auth
+     */
+    _classPrivateMethodInitSpec(this, _maybeEnqueuePage);
+    /**
+     * Determine whether a Link should be included, conforming to any robots filter.
+     * @param {Link} link
+     * @returns {boolean}
+     */
+    _classPrivateMethodInitSpec(this, _isAllowed);
+    /**
+     * Determine whether a Link should be excluded from checks, and the reason for such.
+     * @param {Link} link
+     * @returns {string|undefined}
+     */
+    _classPrivateMethodInitSpec(this, _getExcludedReason);
+    /**
+     * Enqueue a URL to be crawled.
+     * @param {URL} url
+     * @param {*} customData
+     * @param {object} auth
+     */
+    _classPrivateMethodInitSpec(this, _enqueuePage);
+    _classPrivateFieldInitSpec(this, _currentAuth, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentCustomData, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentDone, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentPageError, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentRobotsTxt, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _currentSiteURL, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _htmlUrlChecker, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _options, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _sitePagesChecked, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldInitSpec(this, _siteUrlQueue, {
+      writable: true,
+      value: void 0
+    });
+    _classPrivateFieldSet(this, _options, _classPrivateMethodGet(this, _overrideOptions, _overrideOptions2).call(this, (0, _parseOptions.default)(_options2))); // @todo https://github.com/tc39/proposal-pipeline-operator
+    _classPrivateFieldSet(this, _sitePagesChecked, new _urlcache.default({
+      maxAge: _classPrivateFieldGet(this, _options).cacheMaxAge
+    }));
+    _classPrivateMethodGet(this, _reset, _reset2).call(this);
+    _classPrivateFieldSet(this, _siteUrlQueue, new _limitedRequestQueue.default({
+      maxSockets: 1,
+      rateLimit: _classPrivateFieldGet(this, _options).rateLimit
+    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
+      auth,
+      customData
+    }, done) => {
+      _classPrivateMethodGet(this, _reset, _reset2).call(this);
+      _classPrivateFieldSet(this, _currentAuth, auth);
+      _classPrivateFieldSet(this, _currentCustomData, customData);
+      _classPrivateFieldSet(this, _currentDone, done);
+      _classPrivateFieldSet(this, _currentSiteURL, url); // @todo strip after hostname?
+
+      try {
+        if ((0, _httpProtocol.isCompatibleScheme)(url) && _classPrivateFieldGet(this, _options).honorRobotExclusions) {
+          const robots = await (0, _httpProtocol.getRobotsTxt)(_classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentAuth), this.__cache, _classPrivateFieldGet(this, _options));
+
+          // This receives an instance even if no robots.txt was found
+          _classPrivateFieldSet(this, _currentRobotsTxt, robots);
+          this.emit(_events.ROBOTS_EVENT, robots, _classPrivateFieldGet(this, _currentCustomData));
+        }
+      } catch {
+        // If could not connect to server -- let `HtmlUrlChecker` catch it
+      } finally {
+        _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, _classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentCustomData), _classPrivateFieldGet(this, _currentAuth));
+      }
+    }).on(_limitedRequestQueue.END_EVENT, () => {
+      // Clear references for garbage collection
+      _classPrivateMethodGet(this, _reset, _reset2).call(this);
+      this.emit(_events.END_EVENT);
+    }));
+    _classPrivateFieldSet(this, _htmlUrlChecker, new _HtmlUrlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.HTML_EVENT, (tree, robots, response, pageURL, customData) => {
+      // If was redirected
+      if (response.url !== pageURL) {
+        _classPrivateFieldGet(this, _sitePagesChecked).set(response.url, PAGE_WAS_CHECKED);
+
+        // Avoid rechecking any redirected pages
+        response.redirects.forEach(redirect => _classPrivateFieldGet(this, _sitePagesChecked).set(redirect.url, PAGE_WAS_CHECKED));
+      }
+      this.emit(_events.HTML_EVENT, tree, robots, response, pageURL, customData);
+    }).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, (result, customData) => {
+      this.emit(_events.JUNK_EVENT, result, customData);
+      _classPrivateMethodGet(this, _maybeEnqueuePage, _maybeEnqueuePage2).call(this, result, customData, _classPrivateFieldGet(this, _currentAuth));
+    }).on(_events.LINK_EVENT, (result, customData) => {
+      this.emit(_events.LINK_EVENT, result, customData);
+      _classPrivateMethodGet(this, _maybeEnqueuePage, _maybeEnqueuePage2).call(this, result, customData, _classPrivateFieldGet(this, _currentAuth));
+    }).on(_events.PAGE_EVENT, (error, pageURL, customData) => {
+      this.emit(_events.PAGE_EVENT, error, pageURL, customData);
+
+      // Only the first page should supply an error to SITE_EVENT
+      if (_classPrivateFieldGet(this, _sitePagesChecked).length <= 1) {
+        _classPrivateFieldSet(this, _currentPageError, error);
+      }
+    }).on(_events.END_EVENT, () => {
+      this.emit(_events.SITE_EVENT, _classPrivateFieldGet(this, _currentPageError), _classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentCustomData));
+
+      // Auto-starts next site, if any
+      // Emits REQUEST_QUEUE_END_EVENT, if not
+      _classPrivateFieldGet(this, _currentDone).call(this);
+    }));
+  }
+  clearCache() {
+    // Does not clear `sitePagesChecked` because it would mess up any current scans
+    _classPrivateFieldGet(this, _htmlUrlChecker).clearCache();
+    return this;
+  }
+  dequeue(id) {
+    const success = _classPrivateFieldGet(this, _siteUrlQueue).dequeue(id);
+    this.emit(_events.QUEUE_EVENT);
+    return success;
+  }
+  enqueue(firstPageURL, customData) {
+    const transitive = (0, _httpProtocol.transitiveAuth)(firstPageURL);
+    const success = _classPrivateFieldGet(this, _siteUrlQueue).enqueue(transitive.url, {
+      auth: transitive.auth,
+      customData
+    });
+    this.emit(_events.QUEUE_EVENT);
+    return success;
+  }
+  has(id) {
+    return _classPrivateFieldGet(this, _siteUrlQueue).has(id);
+  }
+  get isPaused() {
+    return _classPrivateFieldGet(this, _htmlUrlChecker).isPaused;
+  }
+  get numActiveLinks() {
+    return _classPrivateFieldGet(this, _htmlUrlChecker).numActiveLinks;
+  }
+  get numQueuedLinks() {
+    return _classPrivateFieldGet(this, _htmlUrlChecker).numQueuedLinks;
+  }
+  get numPages() {
+    return _classPrivateFieldGet(this, _htmlUrlChecker).numPages;
+  }
+  get numSites() {
+    return _classPrivateFieldGet(this, _siteUrlQueue).length;
+  }
+  pause() {
+    _classPrivateFieldGet(this, _htmlUrlChecker).pause();
+    _classPrivateFieldGet(this, _siteUrlQueue).pause();
+    return this;
+  }
+  resume() {
+    _classPrivateFieldGet(this, _htmlUrlChecker).resume();
+    _classPrivateFieldGet(this, _siteUrlQueue).resume();
+    return this;
+  }
+
+  // Useless, but consistent with other classes
+  get __cache() {
+    return _classPrivateFieldGet(this, _htmlUrlChecker).__cache;
+  }
+}
+exports.default = SiteChecker;
+function _enqueuePage2(url, customData, auth) {
+  // Avoid links to self within page
+  _classPrivateFieldGet(this, _sitePagesChecked).set(url, PAGE_WAS_CHECKED);
+  _classPrivateFieldGet(this, _htmlUrlChecker).enqueue(url, customData, auth);
+}
+function _getExcludedReason2(link) {
+  if (link.get(_Link.IS_INTERNAL) && !_classPrivateMethodGet(this, _isAllowed, _isAllowed2).call(this, link)) {
+    return "BLC_ROBOTS";
+  } else {
+    // Not excluded
+  }
+}
+function _isAllowed2(link) {
+  if (_classPrivateFieldGet(this, _options).honorRobotExclusions) {
+    var _link$get;
+    const rebasedPathname = (_link$get = link.get(_Link.REBASED_URL)) === null || _link$get === void 0 ? void 0 : _link$get.pathname;
+
+    // @todo remove condition when/if `Link::invalidate()` is used in `HtmlChecker`
+    if (rebasedPathname !== null) {
+      return _classPrivateFieldGet(this, _currentRobotsTxt).isAllowed(_classPrivateFieldGet(this, _options).userAgent, rebasedPathname);
+    } else {
+      return true;
+    }
+  } else {
+    return true;
+  }
+}
+function _maybeEnqueuePage2(link, customData, auth) {
+  // Skip specific links that were excluded from checks
+  if (link.get(_Link.WAS_EXCLUDED) && PAGE_EXCLUSIONS.includes(link.get(_Link.EXCLUDED_REASON))) {
+    // do nothing
+  } else {
+    const tagGroup = _classPrivateFieldGet(this, _options).tags.recursive[_classPrivateFieldGet(this, _options).filterLevel][link.get(_Link.HTML_TAG_NAME)] ?? {};
+    const attrSupported = (link.get(_Link.HTML_ATTR_NAME) in tagGroup);
+    const rebasedURL = link.get(_Link.REBASED_URL);
+    const redirectedURL = link.get(_Link.REDIRECTED_URL);
+    if (!attrSupported || link.get(_Link.IS_BROKEN) || !link.get(_Link.IS_INTERNAL) || _classPrivateFieldGet(this, _sitePagesChecked).has(rebasedURL) || !_classPrivateMethodGet(this, _isAllowed, _isAllowed2).call(this, link)) {
+      // do nothing
+    } else if (redirectedURL !== null) {
+      // Because only the final redirected page needs to be [recursively] checked,
+      // all redirects are stored as pages that have been checked
+      link.get(_Link.HTTP_RESPONSE).redirects.forEach(({
+        url
+      }) => _classPrivateFieldGet(this, _sitePagesChecked).set(url, PAGE_WAS_CHECKED));
+      if (!_classPrivateFieldGet(this, _sitePagesChecked).has(redirectedURL)) {
+        _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, redirectedURL, customData, auth);
+      }
+    } else if (_classPrivateFieldGet(this, _options).includePage(rebasedURL)) {
+      _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, rebasedURL, customData, auth);
+    }
+  }
+}
+function _overrideOptions2(options) {
+  const {
+    includeLink
+  } = options;
+  options.includeLink = link => {
+    const excludedReason = _classPrivateMethodGet(this, _getExcludedReason, _getExcludedReason2).call(this, link);
+    if (excludedReason === undefined) {
+      return includeLink(link);
+    } else {
+      // Undocumented return value type
+      return excludedReason;
+    }
+  };
+  return options;
+}
+function _reset2() {
+  _classPrivateFieldSet(this, _currentAuth, null);
+  _classPrivateFieldSet(this, _currentCustomData, null);
+  _classPrivateFieldSet(this, _currentDone, null);
+  _classPrivateFieldSet(this, _currentPageError, null);
+  _classPrivateFieldSet(this, _currentRobotsTxt, null);
+  _classPrivateFieldSet(this, _currentSiteURL, null);
+  _classPrivateFieldGet(this, _sitePagesChecked).clear();
+}
+module.exports = exports.default;
+//# sourceMappingURL=SiteChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/SiteChecker.js.map b/lib-cjs/public/SiteChecker.js.map
new file mode 100644
index 00000000..c8d3ea78
--- /dev/null
+++ b/lib-cjs/public/SiteChecker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SiteChecker.js","names":["_events","require","_Link","_httpProtocol","_HtmlUrlChecker","_interopRequireDefault","_parseOptions","_limitedRequestQueue","_interopRequireWildcard","_SafeEventEmitter","_urlcache","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateMethodGet","fn","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","PAGE_EXCLUSIONS","PAGE_WAS_CHECKED","_currentAuth","_currentCustomData","_currentDone","_currentPageError","_currentRobotsTxt","_currentSiteURL","_htmlUrlChecker","_options","_sitePagesChecked","_siteUrlQueue","_enqueuePage","WeakSet","_getExcludedReason","_isAllowed","_maybeEnqueuePage","_overrideOptions","_reset","SiteChecker","SafeEventEmitter","constructor","options","_overrideOptions2","parseOptions","URLCache","maxAge","cacheMaxAge","_reset2","RequestQueue","maxSockets","rateLimit","on","ITEM_EVENT","url","auth","customData","done","isHTTPScheme","honorRobotExclusions","robots","getRobotsTxt","__cache","emit","ROBOTS_EVENT","_enqueuePage2","REQUEST_QUEUE_END_EVENT","END_EVENT","HtmlUrlChecker","ERROR_EVENT","error","HTML_EVENT","tree","response","pageURL","redirects","forEach","redirect","QUEUE_EVENT","JUNK_EVENT","result","_maybeEnqueuePage2","LINK_EVENT","PAGE_EVENT","length","SITE_EVENT","clearCache","dequeue","id","success","enqueue","firstPageURL","transitive","transitiveAuth","isPaused","numActiveLinks","numQueuedLinks","numPages","numSites","pause","resume","exports","_getExcludedReason2","link","IS_INTERNAL","_isAllowed2","_link$get","rebasedPathname","REBASED_URL","pathname","isAllowed","userAgent","WAS_EXCLUDED","includes","EXCLUDED_REASON","tagGroup","tags","recursive","filterLevel","HTML_TAG_NAME","attrSupported","HTML_ATTR_NAME","rebasedURL","redirectedURL","REDIRECTED_URL","IS_BROKEN","HTTP_RESPONSE","includePage","includeLink","excludedReason","undefined","clear","module"],"sources":["../../lib/public/SiteChecker.js"],"sourcesContent":["import {END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT, ROBOTS_EVENT, SITE_EVENT} from \"../internal/events\";\nimport {EXCLUDED_REASON, HTML_ATTR_NAME, HTML_TAG_NAME, HTTP_RESPONSE, IS_BROKEN, IS_INTERNAL, REBASED_URL, REDIRECTED_URL, WAS_EXCLUDED} from \"../internal/Link\";\nimport {getRobotsTxt, isCompatibleScheme as isHTTPScheme, transitiveAuth} from \"../internal/http-protocol\";\nimport HtmlUrlChecker from \"./HtmlUrlChecker\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport URLCache from \"urlcache\";\n\n\n\n// @todo BLC_ROBOTS catches rel=nofollow links but will also catch meta/header excluded links -- fine?\nconst PAGE_EXCLUSIONS = [\"BLC_KEYWORD\", \"BLC_ROBOTS\"];\n\nconst PAGE_WAS_CHECKED = true;\n\n\n\nexport default class SiteChecker extends SafeEventEmitter\n{\n\t#currentAuth;\n\t#currentCustomData;\n\t#currentDone;\n\t#currentPageError;\n\t#currentRobotsTxt;\n\t#currentSiteURL;\n\t#htmlUrlChecker;\n\t#options;\n\t#sitePagesChecked;\n\t#siteUrlQueue;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#options = this.#overrideOptions(parseOptions(options)); // @todo https://github.com/tc39/proposal-pipeline-operator\n\t\tthis.#sitePagesChecked = new URLCache({ maxAge: this.#options.cacheMaxAge });\n\t\tthis.#reset();\n\n\t\tthis.#siteUrlQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets: 1,\n\t\t\trateLimit: this.#options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData}, done) =>\n\t\t{\n\t\t\tthis.#reset();\n\n\t\t\tthis.#currentAuth = auth;\n\t\t\tthis.#currentCustomData = customData;\n\t\t\tthis.#currentDone = done;\n\t\t\tthis.#currentSiteURL = url;  // @todo strip after hostname?\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (isHTTPScheme(url) && this.#options.honorRobotExclusions)\n\t\t\t\t{\n\t\t\t\t\tconst robots = await getRobotsTxt(this.#currentSiteURL, this.#currentAuth, this.__cache, this.#options);\n\n\t\t\t\t\t// This receives an instance even if no robots.txt was found\n\t\t\t\t\tthis.#currentRobotsTxt = robots;\n\n\t\t\t\t\tthis.emit(ROBOTS_EVENT, robots, this.#currentCustomData);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\t// If could not connect to server -- let `HtmlUrlChecker` catch it\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tthis.#enqueuePage(this.#currentSiteURL, this.#currentCustomData, this.#currentAuth);\n\t\t\t}\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () =>\n\t\t{\n\t\t\t// Clear references for garbage collection\n\t\t\tthis.#reset();\n\n\t\t\tthis.emit(END_EVENT);\n\t\t});\n\n\t\tthis.#htmlUrlChecker = new HtmlUrlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(HTML_EVENT, (tree, robots, response, pageURL, customData) =>\n\t\t{\n\t\t\t// If was redirected\n\t\t\tif (response.url !== pageURL)\n\t\t\t{\n\t\t\t\tthis.#sitePagesChecked.set(response.url, PAGE_WAS_CHECKED);\n\n\t\t\t\t// Avoid rechecking any redirected pages\n\t\t\t\tresponse.redirects.forEach(redirect => this.#sitePagesChecked.set(redirect.url, PAGE_WAS_CHECKED));\n\t\t\t}\n\n\t\t\tthis.emit(HTML_EVENT, tree, robots, response, pageURL, customData);\n\t\t})\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, (result, customData) =>\n\t\t{\n\t\t\tthis.emit(JUNK_EVENT, result, customData);\n\n\t\t\tthis.#maybeEnqueuePage(result, customData, this.#currentAuth);\n\t\t})\n\t\t.on(LINK_EVENT, (result, customData) =>\n\t\t{\n\t\t\tthis.emit(LINK_EVENT, result, customData);\n\n\t\t\tthis.#maybeEnqueuePage(result, customData, this.#currentAuth);\n\t\t})\n\t\t.on(PAGE_EVENT, (error, pageURL, customData) =>\n\t\t{\n\t\t\tthis.emit(PAGE_EVENT, error, pageURL, customData);\n\n\t\t\t// Only the first page should supply an error to SITE_EVENT\n\t\t\tif (this.#sitePagesChecked.length <= 1)\n\t\t\t{\n\t\t\t\tthis.#currentPageError = error;\n\t\t\t}\n\t\t})\n\t\t.on(END_EVENT, () =>\n\t\t{\n\t\t\tthis.emit(SITE_EVENT, this.#currentPageError, this.#currentSiteURL, this.#currentCustomData);\n\n\t\t\t// Auto-starts next site, if any\n\t\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\t\tthis.#currentDone();\n\t\t});\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\t// Does not clear `sitePagesChecked` because it would mess up any current scans\n\t\tthis.#htmlUrlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#siteUrlQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\tenqueue(firstPageURL, customData)\n\t{\n\t\tconst transitive = transitiveAuth(firstPageURL);\n\n\t\tconst success = this.#siteUrlQueue.enqueue(transitive.url, { auth:transitive.auth, customData });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t/**\n\t * Enqueue a URL to be crawled.\n\t * @param {URL} url\n\t * @param {*} customData\n\t * @param {object} auth\n\t */\n\t#enqueuePage(url, customData, auth)\n\t{\n\t\t// Avoid links to self within page\n\t\tthis.#sitePagesChecked.set(url, PAGE_WAS_CHECKED);\n\n\t\tthis.#htmlUrlChecker.enqueue(url, customData, auth);\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be excluded from checks, and the reason for such.\n\t * @param {Link} link\n\t * @returns {string|undefined}\n\t */\n\t#getExcludedReason(link)\n\t{\n\t\tif (link.get(IS_INTERNAL) && !this.#isAllowed(link))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Not excluded\n\t\t}\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#siteUrlQueue.has(id);\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be included, conforming to any robots filter.\n\t * @param {Link} link\n\t * @returns {boolean}\n\t */\n\t#isAllowed(link)\n\t{\n\t\tif (this.#options.honorRobotExclusions)\n\t\t{\n\t\t\tconst rebasedPathname = link.get(REBASED_URL)?.pathname;\n\n\t\t\t// @todo remove condition when/if `Link::invalidate()` is used in `HtmlChecker`\n\t\t\tif (rebasedPathname !== null)\n\t\t\t{\n\t\t\t\treturn this.#currentRobotsTxt.isAllowed(this.#options.userAgent, rebasedPathname);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#htmlUrlChecker.isPaused;\n\t}\n\n\n\n\t/**\n\t * Enqueue a page (to be crawled) if it passes filters.\n\t * @param {Link} link\n\t * @param {*} customData\n\t * @param {object} auth\n\t */\n\t#maybeEnqueuePage(link, customData, auth)\n\t{\n\t\t// Skip specific links that were excluded from checks\n\t\tif (link.get(WAS_EXCLUDED) && PAGE_EXCLUSIONS.includes(link.get(EXCLUDED_REASON)))\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst tagGroup = this.#options.tags.recursive[this.#options.filterLevel][link.get(HTML_TAG_NAME)] ?? {};\n\t\t\tconst attrSupported = link.get(HTML_ATTR_NAME) in tagGroup;\n\t\t\tconst rebasedURL = link.get(REBASED_URL);\n\t\t\tconst redirectedURL = link.get(REDIRECTED_URL);\n\n\t\t\tif (\n\t\t\t\t!attrSupported ||\n\t\t\t\tlink.get(IS_BROKEN) ||\n\t\t\t\t!link.get(IS_INTERNAL) ||\n\t\t\t\tthis.#sitePagesChecked.has(rebasedURL) ||\n\t\t\t\t!this.#isAllowed(link)\n\t\t\t   )\n\t\t\t{\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\telse if (redirectedURL !== null)\n\t\t\t{\n\t\t\t\t// Because only the final redirected page needs to be [recursively] checked,\n\t\t\t\t// all redirects are stored as pages that have been checked\n\t\t\t\tlink.get(HTTP_RESPONSE).redirects.forEach(({url}) => this.#sitePagesChecked.set(url, PAGE_WAS_CHECKED));\n\n\t\t\t\tif (!this.#sitePagesChecked.has(redirectedURL))\n\t\t\t\t{\n\t\t\t\t\tthis.#enqueuePage(redirectedURL, customData, auth);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.#options.includePage(rebasedURL))\n\t\t\t{\n\t\t\t\tthis.#enqueuePage(rebasedURL, customData, auth);\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#htmlUrlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#htmlUrlChecker.numQueuedLinks;\n\t}\n\n\n\n\tget numPages()\n\t{\n\t\treturn this.#htmlUrlChecker.numPages;\n\t}\n\n\n\n\tget numSites()\n\t{\n\t\treturn this.#siteUrlQueue.length;\n\t}\n\n\n\n\t/**\n\t * Override/mutate some options for extended behavior.\n\t * @param {object} options\n\t * @returns {object}\n\t */\n\t#overrideOptions(options)\n\t{\n\t\tconst {includeLink} = options;\n\n\t\toptions.includeLink = link =>\n\t\t{\n\t\t\tconst excludedReason = this.#getExcludedReason(link);\n\n\t\t\tif (excludedReason === undefined)\n\t\t\t{\n\t\t\t\treturn includeLink(link);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Undocumented return value type\n\t\t\t\treturn excludedReason;\n\t\t\t}\n\t\t};\n\n\t\treturn options;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#htmlUrlChecker.pause();\n\t\tthis.#siteUrlQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#currentAuth = null;\n\t\tthis.#currentCustomData = null;\n\t\tthis.#currentDone = null;\n\t\tthis.#currentPageError = null;\n\t\tthis.#currentRobotsTxt = null;\n\t\tthis.#currentSiteURL = null;\n\t\tthis.#sitePagesChecked.clear();\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#htmlUrlChecker.resume();\n\t\tthis.#siteUrlQueue.resume();\n\t\treturn this;\n\t}\n\n\n\n\t// Useless, but consistent with other classes\n\tget __cache()\n\t{\n\t\treturn this.#htmlUrlChecker.__cache;\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,oBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,SAAA,GAAAL,sBAAA,CAAAJ,OAAA;AAAgC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SA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sBAAA,KAAI,EAAAkB,YAAA,EAAAiC,aAAA,EAAArE,IAAA,CAAJ,IAAI,EAAc8H,UAAU,EAAElE,UAAU,EAAED,IAAI;IAC/C;EACD;AACD;AAAC,SAAAZ,kBAqCgBD,OAAO,EACxB;EACC,MAAM;IAACsF;EAAW,CAAC,GAAGtF,OAAO;EAE7BA,OAAO,CAACsF,WAAW,GAAGzB,IAAI,IAC1B;IACC,MAAM0B,cAAc,GAAAnH,sBAAA,CAAG,IAAI,EAAAoB,kBAAA,EAAAoE,mBAAA,EAAA1G,IAAA,CAAJ,IAAI,EAAoB2G,IAAI,CAAC;IAEpD,IAAI0B,cAAc,KAAKC,SAAS,EAChC;MACC,OAAOF,WAAW,CAACzB,IAAI,CAAC;IACzB,CAAC,MAED;MACC;MACA,OAAO0B,cAAc;IACtB;EACD,CAAC;EAED,OAAOvF,OAAO;AACf;AAAC,SAAAM,QAAA,EAcD;EACChC,qBAAA,KAAI,EAAAM,YAAA,EAAgB,IAAI;EACxBN,qBAAA,KAAI,EAAAO,kBAAA,EAAsB,IAAI;EAC9BP,qBAAA,KAAI,EAAAQ,YAAA,EAAgB,IAAI;EACxBR,qBAAA,KAAI,EAAAS,iBAAA,EAAqB,IAAI;EAC7BT,qBAAA,KAAI,EAAAU,iBAAA,EAAqB,IAAI;EAC7BV,qBAAA,KAAI,EAAAW,eAAA,EAAmB,IAAI;EAC3BlB,qBAAA,KAAI,EAAAqB,iBAAA,EAAmBqG,KAAK,CAAC,CAAC;AAC/B;AAACC,MAAA,CAAA/B,OAAA,GAAAA,OAAA,CAAArH,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/UrlChecker.js b/lib-cjs/public/UrlChecker.js
new file mode 100644
index 00000000..f99becc2
--- /dev/null
+++ b/lib-cjs/public/UrlChecker.js
@@ -0,0 +1,106 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+var _checkLink = _interopRequireDefault(require("../internal/checkLink"));
+var _events = require("../internal/events");
+var _isurl = _interopRequireDefault(require("isurl"));
+var _Link = _interopRequireWildcard(require("../internal/Link"));
+var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
+var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
+var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
+var _urlcache = _interopRequireDefault(require("urlcache"));
+function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
+function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+class UrlChecker extends _SafeEventEmitter.default {
+  #cache;
+  #linkQueue;
+  constructor(options) {
+    super();
+    options = (0, _parseOptions.default)(options);
+    this.#cache = new _urlcache.default({
+      maxAge: options.cacheMaxAge
+    });
+    this.#linkQueue = new _limitedRequestQueue.default({
+      maxSockets: options.maxSockets,
+      maxSocketsPerHost: options.maxSocketsPerHost,
+      rateLimit: options.rateLimit
+    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
+      auth,
+      customData,
+      link
+    }, done) => {
+      const result = await (0, _checkLink.default)(link, auth, this.#cache, options);
+      if (result.get(_Link.WAS_EXCLUDED)) {
+        this.emit(_events.JUNK_EVENT, result, customData);
+      } else {
+        this.emit(_events.LINK_EVENT, result, customData);
+      }
+
+      // Auto-starts next queue item, if any
+      // Emits REQUEST_QUEUE_END_EVENT, if not
+      done();
+    }).on(_limitedRequestQueue.END_EVENT, () => this.emit(_events.END_EVENT));
+  }
+  clearCache() {
+    this.#cache.clear();
+    return this;
+  }
+  dequeue(id) {
+    const success = this.#linkQueue.dequeue(id);
+    this.emit(_events.QUEUE_EVENT);
+    return success;
+  }
+
+  // `auth` is undocumented and for internal use only
+  enqueue(url, customData, auth = {}) {
+    let link;
+
+    // Undocumented internal use: `enqueue(Link)`
+    if (url instanceof _Link.default) {
+      link = url;
+    }
+    // Documented use: `enqueue(URL)`
+    else if ((0, _isurl.default)(url)) {
+      link = new _Link.default().resolve(url);
+    } else {
+      throw new TypeError("Invalid URL");
+    }
+    const id = this.#linkQueue.enqueue(link.get(_Link.REBASED_URL), {
+      auth,
+      customData,
+      link
+    });
+    this.emit(_events.QUEUE_EVENT);
+    return id;
+  }
+  has(id) {
+    return this.#linkQueue.has(id);
+  }
+  get isPaused() {
+    return this.#linkQueue.isPaused;
+  }
+  get numActiveLinks() {
+    return this.#linkQueue.numActive;
+  }
+  get numQueuedLinks() {
+    return this.#linkQueue.numQueued;
+  }
+  pause() {
+    this.#linkQueue.pause();
+    return this;
+  }
+  resume() {
+    this.#linkQueue.resume();
+    return this;
+  }
+  get __cache() {
+    return this.#cache;
+  }
+}
+exports.default = UrlChecker;
+module.exports = exports.default;
+//# sourceMappingURL=UrlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/UrlChecker.js.map b/lib-cjs/public/UrlChecker.js.map
new file mode 100644
index 00000000..9fb0e6d6
--- /dev/null
+++ b/lib-cjs/public/UrlChecker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"UrlChecker.js","names":["_checkLink","_interopRequireDefault","require","_events","_isurl","_Link","_interopRequireWildcard","_parseOptions","_limitedRequestQueue","_SafeEventEmitter","_urlcache","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","UrlChecker","SafeEventEmitter","cache","linkQueue","constructor","options","parseOptions","URLCache","maxAge","cacheMaxAge","RequestQueue","maxSockets","maxSocketsPerHost","rateLimit","on","ITEM_EVENT","url","auth","customData","link","done","result","checkLink","WAS_EXCLUDED","emit","JUNK_EVENT","LINK_EVENT","REQUEST_QUEUE_END_EVENT","END_EVENT","clearCache","clear","dequeue","id","success","QUEUE_EVENT","enqueue","Link","isURL","resolve","TypeError","REBASED_URL","isPaused","numActiveLinks","numActive","numQueuedLinks","numQueued","pause","resume","__cache","exports","module"],"sources":["../../lib/public/UrlChecker.js"],"sourcesContent":["import checkLink from \"../internal/checkLink\";\nimport {END_EVENT, JUNK_EVENT, LINK_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport isURL from \"isurl\";\nimport Link, {REBASED_URL, WAS_EXCLUDED} from \"../internal/Link\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport URLCache from \"urlcache\";\n\n\n\nexport default class UrlChecker extends SafeEventEmitter\n{\n\t#cache;\n\t#linkQueue;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\n\t\toptions = parseOptions(options);\n\n\t\tthis.#cache = new URLCache({ maxAge:options.cacheMaxAge });\n\n\t\tthis.#linkQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets:        options.maxSockets,\n\t\t\tmaxSocketsPerHost: options.maxSocketsPerHost,\n\t\t\trateLimit:         options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData, link}, done) =>\n\t\t{\n\t\t\tconst result = await checkLink(link, auth, this.#cache, options);\n\n\t\t\tif (result.get(WAS_EXCLUDED))\n\t\t\t{\n\t\t\t\tthis.emit(JUNK_EVENT, result, customData);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.emit(LINK_EVENT, result, customData);\n\t\t\t}\n\n\t\t\t// Auto-starts next queue item, if any\n\t\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\t\tdone();\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () => this.emit(END_EVENT));\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#cache.clear();\n\t\treturn this;\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#linkQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t// `auth` is undocumented and for internal use only\n\tenqueue(url, customData, auth={})\n\t{\n\t\tlet link;\n\n\t\t// Undocumented internal use: `enqueue(Link)`\n\t\tif (url instanceof Link)\n\t\t{\n\t\t\tlink = url;\n\t\t}\n\t\t// Documented use: `enqueue(URL)`\n\t\telse if (isURL(url))\n\t\t{\n\t\t\tlink = new Link().resolve(url);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid URL\");\n\t\t}\n\n\t\tconst id = this.#linkQueue.enqueue(link.get(REBASED_URL), { auth, customData, link });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn id;\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#linkQueue.has(id);\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#linkQueue.isPaused;\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#linkQueue.numActive;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#linkQueue.numQueued;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#linkQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#linkQueue.resume();\n\t\treturn this;\n\t}\n\n\n\n\tget __cache()\n\t{\n\t\treturn this.#cache;\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA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IA,IAAIC,cAAcA,CAAA,EAClB;IACC,OAAO,IAAI,CAAC,CAACvC,SAAS,CAACwC,SAAS;EACjC;EAIA,IAAIC,cAAcA,CAAA,EAClB;IACC,OAAO,IAAI,CAAC,CAACzC,SAAS,CAAC0C,SAAS;EACjC;EAIAC,KAAKA,CAAA,EACL;IACC,IAAI,CAAC,CAAC3C,SAAS,CAAC2C,KAAK,CAAC,CAAC;IACvB,OAAO,IAAI;EACZ;EAIAC,MAAMA,CAAA,EACN;IACC,IAAI,CAAC,CAAC5C,SAAS,CAAC4C,MAAM,CAAC,CAAC;IACxB,OAAO,IAAI;EACZ;EAIA,IAAIC,OAAOA,CAAA,EACX;IACC,OAAO,IAAI,CAAC,CAAC9C,KAAK;EACnB;AACD;AAAC+C,OAAA,CAAAjE,OAAA,GAAAgB,UAAA;AAAAkD,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjE,OAAA"}
\ No newline at end of file

From 554868994e3ca844a19150989c5d9adc50c2df2b Mon Sep 17 00:00:00 2001
From: Ken Hawkins 
Date: Mon, 8 Jan 2024 10:26:27 +0100
Subject: [PATCH 3/3] Revert "Commit lib-cjs to use in projects."

This reverts commit ef73203a13323342dd0b3417b5fbcf926b624a7b.
---
 .gitignore                                    |   1 +
 lib-cjs/cli.js                                | 481 ------------------
 lib-cjs/cli.js.map                            |   1 -
 lib-cjs/index.js                              |  67 ---
 lib-cjs/index.js.map                          |   1 -
 lib-cjs/internal/Link.js                      | 232 ---------
 lib-cjs/internal/Link.js.map                  |   1 -
 lib-cjs/internal/SafeEventEmitter.js          |  25 -
 lib-cjs/internal/SafeEventEmitter.js.map      |   1 -
 lib-cjs/internal/checkLink.js                 |  69 ---
 lib-cjs/internal/checkLink.js.map             |   1 -
 lib-cjs/internal/defaultOptions.js            |  37 --
 lib-cjs/internal/defaultOptions.js.map        |   1 -
 lib-cjs/internal/errors.js                    |  31 --
 lib-cjs/internal/errors.js.map                |   1 -
 lib-cjs/internal/events.js                    |  17 -
 lib-cjs/internal/events.js.map                |   1 -
 lib-cjs/internal/file-protocol/checkLink.js   |  35 --
 .../internal/file-protocol/checkLink.js.map   |   1 -
 lib-cjs/internal/file-protocol/errors.js      |  19 -
 lib-cjs/internal/file-protocol/errors.js.map  |   1 -
 lib-cjs/internal/file-protocol/index.js       |  35 --
 lib-cjs/internal/file-protocol/index.js.map   |   1 -
 .../file-protocol/isCompatibleScheme.js       |  15 -
 .../file-protocol/isCompatibleScheme.js.map   |   1 -
 lib-cjs/internal/file-protocol/streamHTML.js  |  37 --
 .../internal/file-protocol/streamHTML.js.map  |   1 -
 lib-cjs/internal/http-protocol/checkLink.js   |  84 ---
 .../internal/http-protocol/checkLink.js.map   |   1 -
 lib-cjs/internal/http-protocol/errors.js      |  21 -
 lib-cjs/internal/http-protocol/errors.js.map  |   1 -
 .../internal/http-protocol/getRobotsTxt.js    |  41 --
 .../http-protocol/getRobotsTxt.js.map         |   1 -
 lib-cjs/internal/http-protocol/index.js       |  49 --
 lib-cjs/internal/http-protocol/index.js.map   |   1 -
 .../http-protocol/isCompatibleScheme.js       |  17 -
 .../http-protocol/isCompatibleScheme.js.map   |   1 -
 lib-cjs/internal/http-protocol/request.js     | 146 ------
 lib-cjs/internal/http-protocol/request.js.map |   1 -
 lib-cjs/internal/http-protocol/streamHTML.js  |  50 --
 .../internal/http-protocol/streamHTML.js.map  |   1 -
 .../internal/http-protocol/transitiveAuth.js  |  42 --
 .../http-protocol/transitiveAuth.js.map       |   1 -
 lib-cjs/internal/matchURL.js                  |  25 -
 lib-cjs/internal/matchURL.js.map              |   1 -
 lib-cjs/internal/parseHTML.js                 |  59 ---
 lib-cjs/internal/parseHTML.js.map             |   1 -
 lib-cjs/internal/parseOptions.js              |  33 --
 lib-cjs/internal/parseOptions.js.map          |   1 -
 lib-cjs/internal/reasons.js                   |  32 --
 lib-cjs/internal/reasons.js.map               |   1 -
 lib-cjs/internal/scrapeHTML.js                | 269 ----------
 lib-cjs/internal/scrapeHTML.js.map            |   1 -
 lib-cjs/internal/streamHTML.js                |  40 --
 lib-cjs/internal/streamHTML.js.map            |   1 -
 lib-cjs/internal/tags.js                      | 221 --------
 lib-cjs/internal/tags.js.map                  |   1 -
 lib-cjs/public/HtmlChecker.js                 | 229 ---------
 lib-cjs/public/HtmlChecker.js.map             |   1 -
 lib-cjs/public/HtmlUrlChecker.js              | 212 --------
 lib-cjs/public/HtmlUrlChecker.js.map          |   1 -
 lib-cjs/public/SiteChecker.js                 | 319 ------------
 lib-cjs/public/SiteChecker.js.map             |   1 -
 lib-cjs/public/UrlChecker.js                  | 106 ----
 lib-cjs/public/UrlChecker.js.map              |   1 -
 65 files changed, 1 insertion(+), 3127 deletions(-)
 delete mode 100644 lib-cjs/cli.js
 delete mode 100644 lib-cjs/cli.js.map
 delete mode 100644 lib-cjs/index.js
 delete mode 100644 lib-cjs/index.js.map
 delete mode 100644 lib-cjs/internal/Link.js
 delete mode 100644 lib-cjs/internal/Link.js.map
 delete mode 100644 lib-cjs/internal/SafeEventEmitter.js
 delete mode 100644 lib-cjs/internal/SafeEventEmitter.js.map
 delete mode 100644 lib-cjs/internal/checkLink.js
 delete mode 100644 lib-cjs/internal/checkLink.js.map
 delete mode 100644 lib-cjs/internal/defaultOptions.js
 delete mode 100644 lib-cjs/internal/defaultOptions.js.map
 delete mode 100644 lib-cjs/internal/errors.js
 delete mode 100644 lib-cjs/internal/errors.js.map
 delete mode 100644 lib-cjs/internal/events.js
 delete mode 100644 lib-cjs/internal/events.js.map
 delete mode 100644 lib-cjs/internal/file-protocol/checkLink.js
 delete mode 100644 lib-cjs/internal/file-protocol/checkLink.js.map
 delete mode 100644 lib-cjs/internal/file-protocol/errors.js
 delete mode 100644 lib-cjs/internal/file-protocol/errors.js.map
 delete mode 100644 lib-cjs/internal/file-protocol/index.js
 delete mode 100644 lib-cjs/internal/file-protocol/index.js.map
 delete mode 100644 lib-cjs/internal/file-protocol/isCompatibleScheme.js
 delete mode 100644 lib-cjs/internal/file-protocol/isCompatibleScheme.js.map
 delete mode 100644 lib-cjs/internal/file-protocol/streamHTML.js
 delete mode 100644 lib-cjs/internal/file-protocol/streamHTML.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/checkLink.js
 delete mode 100644 lib-cjs/internal/http-protocol/checkLink.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/errors.js
 delete mode 100644 lib-cjs/internal/http-protocol/errors.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/getRobotsTxt.js
 delete mode 100644 lib-cjs/internal/http-protocol/getRobotsTxt.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/index.js
 delete mode 100644 lib-cjs/internal/http-protocol/index.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/isCompatibleScheme.js
 delete mode 100644 lib-cjs/internal/http-protocol/isCompatibleScheme.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/request.js
 delete mode 100644 lib-cjs/internal/http-protocol/request.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/streamHTML.js
 delete mode 100644 lib-cjs/internal/http-protocol/streamHTML.js.map
 delete mode 100644 lib-cjs/internal/http-protocol/transitiveAuth.js
 delete mode 100644 lib-cjs/internal/http-protocol/transitiveAuth.js.map
 delete mode 100644 lib-cjs/internal/matchURL.js
 delete mode 100644 lib-cjs/internal/matchURL.js.map
 delete mode 100644 lib-cjs/internal/parseHTML.js
 delete mode 100644 lib-cjs/internal/parseHTML.js.map
 delete mode 100644 lib-cjs/internal/parseOptions.js
 delete mode 100644 lib-cjs/internal/parseOptions.js.map
 delete mode 100644 lib-cjs/internal/reasons.js
 delete mode 100644 lib-cjs/internal/reasons.js.map
 delete mode 100644 lib-cjs/internal/scrapeHTML.js
 delete mode 100644 lib-cjs/internal/scrapeHTML.js.map
 delete mode 100644 lib-cjs/internal/streamHTML.js
 delete mode 100644 lib-cjs/internal/streamHTML.js.map
 delete mode 100644 lib-cjs/internal/tags.js
 delete mode 100644 lib-cjs/internal/tags.js.map
 delete mode 100644 lib-cjs/public/HtmlChecker.js
 delete mode 100644 lib-cjs/public/HtmlChecker.js.map
 delete mode 100644 lib-cjs/public/HtmlUrlChecker.js
 delete mode 100644 lib-cjs/public/HtmlUrlChecker.js.map
 delete mode 100644 lib-cjs/public/SiteChecker.js
 delete mode 100644 lib-cjs/public/SiteChecker.js.map
 delete mode 100644 lib-cjs/public/UrlChecker.js
 delete mode 100644 lib-cjs/public/UrlChecker.js.map

diff --git a/.gitignore b/.gitignore
index 116220c3..033f9d61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 coverage/
+lib-cjs/
 node_modules/
 package-lock.json
diff --git a/lib-cjs/cli.js b/lib-cjs/cli.js
deleted file mode 100644
index d58b9414..00000000
--- a/lib-cjs/cli.js
+++ /dev/null
@@ -1,481 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _Link = require("./internal/Link");
-var _defaultOptions = _interopRequireDefault(require("./internal/defaultOptions"));
-var _events = require("./internal/events");
-var _gauge = _interopRequireDefault(require("gauge"));
-var _httpMethodsConstants = require("http-methods-constants");
-var _chalk = require("chalk");
-var _ = require("./");
-var _humanizeDuration = _interopRequireDefault(require("humanize-duration"));
-var _longest = _interopRequireDefault(require("longest"));
-var _keyscan = require("keyscan");
-var _nodeNotifier = _interopRequireDefault(require("node-notifier"));
-var _url = require("url");
-var _stripAnsi = _interopRequireDefault(require("strip-ansi"));
-var _supportsSemigraphics = _interopRequireDefault(require("supports-semigraphics"));
-var _themes = require("gauge/themes");
-var _package = require("../package.json");
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-/* eslint-disable no-console */
-
-const title = "Broken Link Checker";
-let checker, checkerOptions, gauge, keyScanner, logOptions, pauseMessage, spinner, stats, urls;
-const argsToOptions = args => {
-  const renames = {
-    exclude: "excludedKeywords",
-    excludeExternal: "excludeExternalLinks",
-    excludeInternal: "excludeInternalLinks",
-    follow: "followRobotExclusions",
-    hostRequests: "maxSocketsPerHost",
-    include: "includedKeywords",
-    ordered: "maintainLinkOrder",
-    requests: "maxSockets"
-  };
-  return Object.entries(args).reduce((opts, [argName, argValue]) => {
-    if (argName in renames) {
-      opts[renames[argName]] = argValue;
-    } else if (argName in _defaultOptions.default) {
-      opts[argName] = argValue;
-    } else if (args.get) {
-      opts.requestMethod = _httpMethodsConstants.GET;
-    }
-    return opts;
-  }, {});
-};
-const log = (...args) => {
-  // Avoid spinner/progress chars getting stuck in the log
-  gauge.hide();
-  console.log(...args);
-  gauge.show();
-};
-const logPage = pageURL => {
-  log(`${(0, _chalk.white)("\nGetting links from:")} ${(0, _chalk.yellow)(pageURL)}`);
-};
-const logPageMetrics = () => {
-  let output = (0, _chalk.gray)(`Finished! ${stats.page.totalLinks} links found.`);
-  if (stats.page.skippedLinks > 0) {
-    output += (0, _chalk.gray)(` ${stats.page.skippedLinks} skipped.`);
-  }
-  if (stats.page.totalLinks > 0) {
-    output += (0, _chalk.gray)(" ");
-    if (stats.page.brokenLinks > 0) {
-      output += (0, _chalk.red)(`${stats.page.brokenLinks} broken`);
-    } else {
-      output += (0, _chalk.green)(`${stats.page.brokenLinks} broken`);
-    }
-    output += (0, _chalk.gray)(".");
-  }
-  log(output);
-};
-const logProgress = () => {
-  const links = checker.numActiveLinks + checker.numQueuedLinks;
-  const pageCompletion = links > 0 ? 1 / links : 0;
-  if (logOptions.recursive) {
-    gauge.show(`Links:${links} Pages:${checker.numPages} Sites:${checker.numSites}`, pageCompletion);
-  } else {
-    gauge.show(`Links:${links} Pages:${checker.numPages}`, pageCompletion);
-  }
-};
-const logResult = /*(*/(result /*, finalResult)*/) => {
-  if (result.displayed) {
-    // @todo if the last result is skipped, the last RENDERED result will not be "└─"
-    let output = (0, _chalk.gray)( /*finalResult!==true ?*/"├─" /*: "└─"*/);
-    const {
-      link
-    } = result;
-    if (link.get(_Link.IS_BROKEN)) {
-      output += (0, _chalk.red)("BROKEN");
-      output += (0, _chalk.gray)("─ ");
-    } else if (link.get(_Link.WAS_EXCLUDED)) {
-      output += (0, _chalk.gray)("─SKIP── ");
-    } else {
-      output += (0, _chalk.gray)("──");
-      output += (0, _chalk.green)("OK");
-      output += (0, _chalk.gray)("─── ");
-    }
-
-    // @todo is ORIGINAL_URL only for invalid links?
-    output += (0, _chalk.yellow)(link.get(_Link.REBASED_URL) ?? link.get(_Link.ORIGINAL_URL));
-    if (link.get(_Link.IS_BROKEN)) {
-      output += (0, _chalk.gray)(` (${link.get(_Link.BROKEN_REASON)})`);
-    } else if (link.get(_Link.WAS_EXCLUDED)) {
-      output += (0, _chalk.gray)(` (${link.get(_Link.EXCLUDED_REASON)})`);
-    }
-    // Don't display cached message if broken/excluded message is displayed
-    else if (link.get(_Link.HTTP_RESPONSE_WAS_CACHED)) {
-      output += (0, _chalk.gray)(" (CACHED)");
-    }
-    log(output);
-  }
-};
-
-/**
- * Logs links in the order that they are found in their containing HTML
- * document, even if later links receive an earlier response.
- */
-const logResults = () => {
-  // eslint-disable-next-line no-constant-condition
-  while (true) {
-    const result = stats.page.results[stats.page.currentIndex];
-    if (result !== undefined) {
-      //const final = stats.page.currentIndex>=stats.page.results.length-1 && checker.numActiveLinks===0 && checker.numQueuedLinks===0;
-
-      logResult(result /*, final*/);
-      stats.page.currentIndex++;
-    } else {
-      break;
-    }
-  }
-};
-const logSite = () => {
-  let output = "";
-  if (++stats.site.totalPages > 1) {
-    output += "\n";
-  }
-  output += (0, _chalk.white)("\nStarting recursive scan...");
-  log(output);
-};
-
-// @todo number of unique/uncached links
-// @todo "excluded links" [from cli] doesn't make sense with a value of 0 when there're skipped links in the log
-const logSiteMetrics = () => {
-  let output = "";
-  output += (0, _chalk.gray)(`\nLinks found: ${stats.site.totalLinks}`);
-  output += (0, _chalk.gray)(`\nLinks skipped: ${stats.site.skippedLinks}`);
-  output += (0, _chalk.gray)(`\nLinks successful: ${stats.site.totalLinks - stats.site.skippedLinks - stats.site.brokenLinks}`);
-  let broken;
-  if (stats.site.totalLinks > 0) {
-    broken = stats.site.brokenLinks > 0 ? _chalk.red : _chalk.green;
-  } else {
-    broken = _chalk.gray;
-  }
-  output += broken(`\nLinks broken: ${stats.site.brokenLinks}`);
-  output += (0, _chalk.gray)("\nTime elapsed: ");
-  output += (0, _chalk.gray)((0, _humanizeDuration.default)(Date.now() - stats.site.startTime, {
-    largest: 2,
-    round: true
-  }));
-  const separator = (0, _chalk.gray)("=".repeat((0, _longest.default)((0, _stripAnsi.default)(output).split("\n")).length));
-  log(`\n${separator}${output}\n${separator}\n`);
-};
-const run = () => {
-  Object.values(_themes.themes).forEach(theme => {
-    //theme.preProgressbar = `\n\n${theme.preProgressbar}`;
-    theme.preSubsection = (0, _chalk.gray)("—");
-  });
-  gauge = new _gauge.default();
-  stats = new Statistics();
-  if (logOptions.recursive) {
-    checker = new _.SiteChecker(checkerOptions);
-  } else {
-    checker = new _.HtmlUrlChecker(checkerOptions);
-  }
-  checker.on(_events.HTML_EVENT, (tree, robots, response, pageURL) => {
-    logPage(pageURL);
-  }).on(_events.QUEUE_EVENT, () => {
-    logProgress();
-  }).on(_events.JUNK_EVENT, link => {
-    stats.pushResult(link);
-    logProgress();
-    logResults();
-  }).on(_events.LINK_EVENT, link => {
-    stats.pushResult(link);
-    logProgress();
-    logResults();
-  }).on(_events.PAGE_EVENT, (error, pageURL) => {
-    if (error != null) {
-      // HTML_EVENT will not have been called
-      logPage(pageURL);
-      if (error.code < 200 || error.code > 299) {
-        log((0, _chalk.red)(`${error.name}: ${error.message}`));
-      } else {
-        log((0, _chalk.gray)(`${error.name}: ${error.message}`));
-      }
-      process.exitCode = 1;
-    }
-    // If more than a total of one page will be scanned
-    else if (logOptions.recursive || urls.length > 1) {
-      logPageMetrics();
-      logProgress();
-      stats.resetPage();
-
-      // If nothing after current page
-      if (checker.numPages === 1) {
-        logSiteMetrics();
-      }
-    } else {
-      logSiteMetrics();
-    }
-  }).on(_events.SITE_EVENT, () => {
-    logSiteMetrics();
-    stats.resetSite();
-  }).on(_events.END_EVENT, () => {
-    // @todo store multiple site stats in an array and log all site metrics at very end?
-
-    if ((0, _supportsSemigraphics.default)()) {
-      // Exit gracefully
-      clearTimeout(spinner);
-      gauge.disable();
-      keyScanner.release();
-
-      // @todo https://github.com/mikaelbr/node-notifier/issues/174
-      _nodeNotifier.default.notify({
-        message: "Finished!",
-        title
-      });
-    }
-  }).on(_events.ERROR_EVENT, error => {
-    console.error(error);
-
-    // eslint-disable-next-line no-process-exit
-    process.exit(1);
-  });
-  if (logOptions.recursive) {
-    logSite();
-  }
-  if ((0, _supportsSemigraphics.default)()) {
-    // Show pause message
-    togglePause(false);
-    keyScanner = (0, _keyscan.make_scanner)(key => {
-      if (key.parsed === "space") {
-        togglePause();
-      }
-    });
-  } else {
-    gauge.disable();
-  }
-  try {
-    checker.pause(); // avoid auto-start
-
-    urls.map(url => {
-      try {
-        url = new URL(url);
-      } catch {
-        url = (0, _url.pathToFileURL)(url);
-      }
-      return url;
-    }).forEach(url => checker.enqueue(url));
-    checker.resume(); // start, if above didn't throw
-  } catch ({
-    message
-  }) {
-    console.error(message);
-    process.exitCode = 1;
-  }
-};
-const spinnerInterval = () => {
-  spinner = setTimeout(() => {
-    gauge.pulse(pauseMessage);
-    spinnerInterval();
-  }, 50);
-};
-class Statistics {
-  constructor() {
-    this.page = {};
-    this.site = {};
-    this.resetSite();
-  }
-  pushResult(link) {
-    const result = {
-      displayed: true,
-      link
-    };
-    const hideCachedLink = logOptions.hideCachedLinks && link.get(_Link.IS_BROKEN) === false && link.get(_Link.HTTP_RESPONSE_WAS_CACHED);
-    const hideSkippedLink = logOptions.hideSkippedLinks && link.get(_Link.WAS_EXCLUDED);
-    const hideUnbrokenLink = logOptions.hideUnbrokenLinks && link.get(_Link.IS_BROKEN) === false;
-    if (hideCachedLink || hideSkippedLink || hideUnbrokenLink) {
-      this.page.hiddenLinks++;
-      this.site.hiddenLinks++;
-      result.displayed = false;
-    }
-    if (link.get(_Link.IS_BROKEN)) {
-      this.page.brokenLinks++;
-      this.site.brokenLinks++;
-      process.exitCode = 1;
-    } else if (link.get(_Link.WAS_EXCLUDED)) {
-      this.page.skippedLinks++;
-      this.site.skippedLinks++;
-    }
-    this.page.totalLinks++;
-    this.site.totalLinks++;
-    if (logOptions.maintainLinkOrder) {
-      this.page.results[link.get(_Link.HTML_INDEX)] = result;
-    } else {
-      this.page.results.push(result);
-    }
-  }
-  resetPage() {
-    this.page.brokenLinks = 0;
-    this.page.currentIndex = 0;
-    this.page.hiddenLinks = 0;
-    this.page.results = [];
-    this.page.skippedLinks = 0;
-    //this.page.startTime = Date.now();
-    this.page.totalLinks = 0;
-  }
-  resetSite() {
-    this.resetPage();
-    this.site.brokenLinks = 0;
-    this.site.hiddenLinks = 0;
-    this.site.skippedLinks = 0;
-    this.site.startTime = Date.now();
-    this.site.totalLinks = 0;
-    this.site.totalPages = 0;
-  }
-}
-const togglePause = pause => {
-  if (pause === undefined) {
-    pause = !checker.isPaused;
-  }
-  if (pause) {
-    checker.pause();
-    pauseMessage = `${(0, _chalk.yellow)("PAUSED")}${(0, _chalk.gray)(" — press space to resume")}`;
-    gauge.pulse(pauseMessage);
-    clearTimeout(spinner);
-  } else {
-    checker.resume();
-    pauseMessage = (0, _chalk.gray)("press space to pause");
-    spinner = spinnerInterval();
-  }
-  logProgress();
-};
-var _default = (args = process.argv) => {
-  const filterLevel = ["--filter-level:", "  0: clickable links", "  1: 0 + media, frames, meta refreshes", "  2: 1 + stylesheets, scripts, forms", "  3: 2 + metadata"].join("\n");
-  const verbosity = ["--verbosity:", "  0: broken links", "  1: 0 + unbroken links", "  2: 1 + skipped links"].join("\n");
-
-  /* eslint-disable sort-keys */
-  const optionator = require("optionator")({
-    prepend: `${(0, _chalk.yellow)(title.toUpperCase())}\n\n${(0, _chalk.green)("Usage:")} blc [options] url1 [url2 ...]`,
-    append: `${(0, _chalk.gray)(filterLevel)}\n\n${(0, _chalk.gray)(verbosity)}\n`,
-    options: [{
-      heading: "Common Options"
-    }, {
-      option: "recursive",
-      alias: "r",
-      type: "Boolean",
-      description: `Recursively scan ("crawl") the HTML document(s)`,
-      default: "false"
-    }, {
-      heading: "Filtering Options"
-    }, {
-      option: "exclude",
-      type: "[String]",
-      description: "Skip checking of links that match keywords/glob"
-    }, {
-      option: "exclude-external",
-      alias: "e",
-      type: "Boolean",
-      description: "Skip checking of external links",
-      default: "false"
-    }, {
-      option: "exclude-internal",
-      alias: "i",
-      type: "Boolean",
-      description: "Skip checking of internal links",
-      default: "false"
-    }, {
-      option: "filter-level",
-      type: "Number",
-      description: "Include checking of links by HTML properties",
-      default: `${_defaultOptions.default.filterLevel}`
-    }, {
-      option: "follow",
-      alias: "f",
-      type: "Boolean",
-      description: "Force-follow robot exclusions",
-      default: "false"
-    }, {
-      option: "include",
-      type: "[String]",
-      description: "Only check links that match keywords/glob"
-    }, {
-      heading: "Display Options"
-    }, {
-      option: "help",
-      alias: "h",
-      type: "Boolean",
-      description: "Display this help text",
-      default: "false"
-    }, {
-      option: "ordered",
-      alias: "o",
-      type: "Boolean",
-      description: "Maintain the order of links as they appear in their HTML document",
-      default: "false"
-    }, {
-      option: "verbosity",
-      type: "Number",
-      description: "The display verbosity level",
-      default: "1"
-    }, {
-      option: "version",
-      alias: "v",
-      type: "Boolean",
-      description: "Display the app version",
-      default: "false"
-    }, {
-      heading: "Advanced Options"
-    }, {
-      option: "get",
-      alias: "g",
-      type: "Boolean",
-      description: "Change request method to GET",
-      default: "false"
-    }, {
-      option: "host-requests",
-      type: "Number",
-      description: "Concurrent requests limit per host",
-      default: `${_defaultOptions.default.maxSocketsPerHost}`
-    }, {
-      option: "requests",
-      type: "Number",
-      description: "Concurrent requests limit ",
-      default: `${_defaultOptions.default.maxSockets}`
-    }, {
-      option: "user-agent",
-      type: "String",
-      description: "The user agent to use for checking links"
-    }]
-  });
-  /* eslint-disable sort-keys */
-
-  try {
-    if (args === process.argv) {
-      args = optionator.parseArgv(args);
-    } else {
-      args = optionator.parse(args);
-    }
-  } catch (error) {
-    args = error;
-  }
-  if (args instanceof Error) {
-    console.error(args.message);
-    process.exitCode = 1;
-  } else if (args.help) {
-    console.log(optionator.generateHelp());
-  } else if (args.version) {
-    console.log(_package.version);
-  } else if (args._.length > 0) {
-    urls = args._;
-    checkerOptions = argsToOptions(args);
-    logOptions = {
-      hideCachedLinks: args.verbosity < 2,
-      hideSkippedLinks: args.verbosity < 2,
-      hideUnbrokenLinks: args.verbosity < 1,
-      maintainLinkOrder: args.ordered,
-      recursive: args.recursive === true // default value is undefined
-    };
-    run();
-  } else {
-    console.error("At least one URL is required; see '--help'");
-    process.exitCode = 1;
-  }
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=cli.js.map
\ No newline at end of file
diff --git a/lib-cjs/cli.js.map b/lib-cjs/cli.js.map
deleted file mode 100644
index 9bf7ee74..00000000
--- a/lib-cjs/cli.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"cli.js","names":["_Link","require","_defaultOptions","_interopRequireDefault","_events","_gauge","_httpMethodsConstants","_chalk","_","_humanizeDuration","_longest","_keyscan","_nodeNotifier","_url","_stripAnsi","_supportsSemigraphics","_themes","_package","obj","__esModule","default","title","checker","checkerOptions","gauge","keyScanner","logOptions","pauseMessage","spinner","stats","urls","argsToOptions","args","renames","exclude","excludeExternal","excludeInternal","follow","hostRequests","include","ordered","requests","Object","entries","reduce","opts","argName","argValue","DEFAULT_OPTIONS","get","requestMethod","GET","log","hide","console","show","logPage","pageURL","white","yellow","logPageMetrics","output","gray","page","totalLinks","skippedLinks","brokenLinks","red","green","logProgress","links","numActiveLinks","numQueuedLinks","pageCompletion","recursive","numPages","numSites","logResult","result","displayed","link","IS_BROKEN","WAS_EXCLUDED","REBASED_URL","ORIGINAL_URL","BROKEN_REASON","EXCLUDED_REASON","HTTP_RESPONSE_WAS_CACHED","logResults","results","currentIndex","undefined","logSite","site","totalPages","logSiteMetrics","broken","humanizeDuration","Date","now","startTime","largest","round","separator","repeat","longest","stripAnsi","split","length","run","values","gaugeThemes","forEach","theme","preSubsection","Gauge","Statistics","SiteChecker","HtmlUrlChecker","on","HTML_EVENT","tree","robots","response","QUEUE_EVENT","JUNK_EVENT","pushResult","LINK_EVENT","PAGE_EVENT","error","code","name","message","process","exitCode","resetPage","SITE_EVENT","resetSite","END_EVENT","supportsSemigraphics","clearTimeout","disable","release","notifier","notify","ERROR_EVENT","exit","togglePause","scanKeys","key","parsed","pause","map","url","URL","pathToFileURL","enqueue","resume","spinnerInterval","setTimeout","pulse","constructor","hideCachedLink","hideCachedLinks","hideSkippedLink","hideSkippedLinks","hideUnbrokenLink","hideUnbrokenLinks","hiddenLinks","maintainLinkOrder","HTML_INDEX","push","isPaused","_default","argv","filterLevel","join","verbosity","optionator","prepend","toUpperCase","append","options","heading","option","alias","type","description","maxSocketsPerHost","maxSockets","parseArgv","parse","Error","help","generateHelp","version","packageVersion","exports","module"],"sources":["../lib/cli.js"],"sourcesContent":["/* eslint-disable no-console */\nimport {BROKEN_REASON, EXCLUDED_REASON, HTML_INDEX, HTTP_RESPONSE_WAS_CACHED, IS_BROKEN, ORIGINAL_URL, REBASED_URL, WAS_EXCLUDED} from \"./internal/Link\";\nimport DEFAULT_OPTIONS from \"./internal/defaultOptions\";\nimport {END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT, SITE_EVENT} from \"./internal/events\";\nimport Gauge from \"gauge\";\nimport {GET} from \"http-methods-constants\";\nimport {gray, green, red, white, yellow} from \"chalk\";\nimport {HtmlUrlChecker, SiteChecker} from \"./\";\nimport humanizeDuration from \"humanize-duration\";\nimport longest from \"longest\";\nimport {make_scanner as scanKeys} from \"keyscan\";\nimport notifier from \"node-notifier\";\nimport {pathToFileURL} from \"url\";\nimport stripAnsi from \"strip-ansi\";\nimport supportsSemigraphics from \"supports-semigraphics\";\nimport {themes as gaugeThemes} from \"gauge/themes\";\nimport {version as packageVersion} from \"../package.json\";\n\n\n\nconst title = \"Broken Link Checker\";\nlet checker,checkerOptions,gauge,keyScanner,logOptions,pauseMessage,spinner,stats,urls;\n\n\n\nconst argsToOptions = args =>\n{\n\tconst renames =\n\t{\n\t\texclude: \"excludedKeywords\",\n\t\texcludeExternal: \"excludeExternalLinks\",\n\t\texcludeInternal: \"excludeInternalLinks\",\n\t\tfollow: \"followRobotExclusions\",\n\t\thostRequests: \"maxSocketsPerHost\",\n\t\tinclude: \"includedKeywords\",\n\t\tordered: \"maintainLinkOrder\",\n\t\trequests: \"maxSockets\"\n\t};\n\n\treturn Object.entries(args).reduce((opts, [argName, argValue]) =>\n\t{\n\t\tif (argName in renames)\n\t\t{\n\t\t\topts[ renames[argName] ] = argValue;\n\t\t}\n\t\telse if (argName in DEFAULT_OPTIONS)\n\t\t{\n\t\t\topts[argName] = argValue;\n\t\t}\n\t\telse if (args.get)\n\t\t{\n\t\t\topts.requestMethod = GET;\n\t\t}\n\n\t\treturn opts;\n\t}, {});\n};\n\n\n\nconst log = (...args) =>\n{\n\t// Avoid spinner/progress chars getting stuck in the log\n\tgauge.hide();\n\n\tconsole.log(...args);\n\n\tgauge.show();\n};\n\n\n\nconst logPage = pageURL =>\n{\n\tlog(`${white(\"\\nGetting links from:\")} ${yellow(pageURL)}`);\n};\n\n\n\nconst logPageMetrics = () =>\n{\n\tlet output = gray(`Finished! ${stats.page.totalLinks} links found.`);\n\n\tif (stats.page.skippedLinks > 0)\n\t{\n\t\toutput += gray(` ${stats.page.skippedLinks} skipped.`);\n\t}\n\n\tif (stats.page.totalLinks > 0)\n\t{\n\t\toutput += gray(\" \");\n\n\t\tif (stats.page.brokenLinks > 0)\n\t\t{\n\t\t\toutput += red(`${stats.page.brokenLinks} broken`);\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutput += green(`${stats.page.brokenLinks} broken`);\n\t\t}\n\n\t\toutput += gray(\".\");\n\t}\n\n\tlog(output);\n};\n\n\n\nconst logProgress = () =>\n{\n\tconst links = checker.numActiveLinks + checker.numQueuedLinks;\n\n\tconst pageCompletion = links>0 ? 1/links : 0;\n\n\tif (logOptions.recursive)\n\t{\n\t\tgauge.show(`Links:${links} Pages:${checker.numPages} Sites:${checker.numSites}`, pageCompletion);\n\t}\n\telse\n\t{\n\t\tgauge.show(`Links:${links} Pages:${checker.numPages}`, pageCompletion);\n\t}\n};\n\n\n\nconst logResult = /*(*/result/*, finalResult)*/ =>\n{\n\tif (result.displayed)\n\t{\n\t\t// @todo if the last result is skipped, the last RENDERED result will not be \"└─\"\n\t\tlet output = gray( /*finalResult!==true ?*/ \"├─\" /*: \"└─\"*/ );\n\n\t\tconst {link} = result;\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\toutput += red(\"BROKEN\");\n\t\t\toutput += gray(\"─ \");\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\toutput += gray(\"─SKIP── \");\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutput += gray(\"──\");\n\t\t\toutput += green(\"OK\");\n\t\t\toutput += gray(\"─── \");\n\t\t}\n\n\t\t// @todo is ORIGINAL_URL only for invalid links?\n\t\toutput += yellow( link.get(REBASED_URL) ?? link.get(ORIGINAL_URL) );\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\toutput += gray(` (${link.get(BROKEN_REASON)})`);\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\toutput += gray(` (${link.get(EXCLUDED_REASON)})`);\n\t\t}\n\t\t// Don't display cached message if broken/excluded message is displayed\n\t\telse if (link.get(HTTP_RESPONSE_WAS_CACHED))\n\t\t{\n\t\t\toutput += gray(\" (CACHED)\");\n\t\t}\n\n\t\tlog(output);\n\t}\n};\n\n\n\n/**\n * Logs links in the order that they are found in their containing HTML\n * document, even if later links receive an earlier response.\n */\nconst logResults = () =>\n{\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true)\n\t{\n\t\tconst result = stats.page.results[stats.page.currentIndex];\n\n\t\tif (result !== undefined)\n\t\t{\n\t\t\t//const final = stats.page.currentIndex>=stats.page.results.length-1 && checker.numActiveLinks===0 && checker.numQueuedLinks===0;\n\n\t\t\tlogResult(result/*, final*/);\n\n\t\t\tstats.page.currentIndex++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n};\n\n\n\nconst logSite = () =>\n{\n\tlet output = \"\";\n\n\tif (++stats.site.totalPages > 1)\n\t{\n\t\toutput += \"\\n\";\n\t}\n\n\toutput += white(\"\\nStarting recursive scan...\");\n\n\tlog(output);\n};\n\n\n\n// @todo number of unique/uncached links\n// @todo \"excluded links\" [from cli] doesn't make sense with a value of 0 when there're skipped links in the log\nconst logSiteMetrics = () =>\n{\n\tlet output = \"\";\n\toutput += gray(`\\nLinks found: ${stats.site.totalLinks}`);\n\toutput += gray(`\\nLinks skipped: ${stats.site.skippedLinks}`);\n\toutput += gray(`\\nLinks successful: ${stats.site.totalLinks - stats.site.skippedLinks - stats.site.brokenLinks}`);\n\n\tlet broken;\n\n\tif (stats.site.totalLinks > 0)\n\t{\n\t\tbroken = stats.site.brokenLinks>0 ? red : green;\n\t}\n\telse\n\t{\n\t\tbroken = gray;\n\t}\n\n\toutput += broken(`\\nLinks broken: ${stats.site.brokenLinks}`);\n\toutput += gray(\"\\nTime elapsed: \");\n\toutput += gray( humanizeDuration(Date.now() - stats.site.startTime, {largest:2, round:true}) );\n\n\tconst separator = gray(\"=\".repeat( longest(stripAnsi(output).split(\"\\n\")).length ));\n\n\tlog(`\\n${separator}${output}\\n${separator}\\n`);\n};\n\n\n\nconst run = () =>\n{\n\tObject.values(gaugeThemes).forEach(theme =>\n\t{\n\t\t//theme.preProgressbar = `\\n\\n${theme.preProgressbar}`;\n\t\ttheme.preSubsection = gray(\"—\");\n\t});\n\n\tgauge = new Gauge();\n\tstats = new Statistics();\n\n\tif (logOptions.recursive)\n\t{\n\t\tchecker = new SiteChecker(checkerOptions);\n\t}\n\telse\n\t{\n\t\tchecker = new HtmlUrlChecker(checkerOptions);\n\t}\n\n\tchecker\n\t.on(HTML_EVENT, (tree, robots, response, pageURL) =>\n\t{\n\t\tlogPage(pageURL);\n\t})\n\t.on(QUEUE_EVENT, () =>\n\t{\n\t\tlogProgress();\n\t})\n\t.on(JUNK_EVENT, link =>\n\t{\n\t\tstats.pushResult(link);\n\t\tlogProgress();\n\t\tlogResults();\n\t})\n\t.on(LINK_EVENT, link =>\n\t{\n\t\tstats.pushResult(link);\n\t\tlogProgress();\n\t\tlogResults();\n\t})\n\t.on(PAGE_EVENT, (error, pageURL) =>\n\t{\n\t\tif (error != null)\n\t\t{\n\t\t\t// HTML_EVENT will not have been called\n\t\t\tlogPage(pageURL);\n\n\t\t\tif (error.code<200 || error.code>299)\n\t\t\t{\n\t\t\t\tlog( red(`${error.name}: ${error.message}`) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog( gray(`${error.name}: ${error.message}`) );\n\t\t\t}\n\n\t\t\tprocess.exitCode = 1;\n\t\t}\n\t\t// If more than a total of one page will be scanned\n\t\telse if (logOptions.recursive || urls.length>1)\n\t\t{\n\t\t\tlogPageMetrics();\n\t\t\tlogProgress();\n\t\t\tstats.resetPage();\n\n\t\t\t// If nothing after current page\n\t\t\tif (checker.numPages === 1)\n\t\t\t{\n\t\t\t\tlogSiteMetrics();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlogSiteMetrics();\n\t\t}\n\t})\n\t.on(SITE_EVENT, () =>\n\t{\n\t\tlogSiteMetrics();\n\t\tstats.resetSite();\n\t})\n\t.on(END_EVENT, () =>\n\t{\n\t\t// @todo store multiple site stats in an array and log all site metrics at very end?\n\n\t\tif (supportsSemigraphics())\n\t\t{\n\t\t\t// Exit gracefully\n\t\t\tclearTimeout(spinner);\n\t\t\tgauge.disable();\n\t\t\tkeyScanner.release();\n\n\t\t\t// @todo https://github.com/mikaelbr/node-notifier/issues/174\n\t\t\tnotifier.notify({ message:\"Finished!\", title });\n\t\t}\n\t})\n\t.on(ERROR_EVENT, error =>\n\t{\n\t\tconsole.error(error);\n\n\t\t// eslint-disable-next-line no-process-exit\n\t\tprocess.exit(1);\n\t});\n\n\tif (logOptions.recursive)\n\t{\n\t\tlogSite();\n\t}\n\n\tif (supportsSemigraphics())\n\t{\n\t\t// Show pause message\n\t\ttogglePause(false);\n\n\t\tkeyScanner = scanKeys(key =>\n\t\t{\n\t\t\tif (key.parsed === \"space\")\n\t\t\t{\n\t\t\t\ttogglePause();\n\t\t\t}\n\t\t});\n\t}\n\telse\n\t{\n\t\tgauge.disable();\n\t}\n\n\ttry\n\t{\n\t\tchecker.pause();  // avoid auto-start\n\n\t\turls\n\t\t.map(url =>\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\turl = new URL(url);\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\turl = pathToFileURL(url);\n\t\t\t}\n\n\t\t\treturn url;\n\t\t})\n\t\t.forEach(url => checker.enqueue(url));\n\n\t\tchecker.resume();  // start, if above didn't throw\n\t}\n\tcatch ({message})\n\t{\n\t\tconsole.error(message);\n\t\tprocess.exitCode = 1;\n\t}\n};\n\n\n\nconst spinnerInterval = () =>\n{\n\tspinner = setTimeout(() =>\n\t{\n\t\tgauge.pulse(pauseMessage);\n\t\tspinnerInterval();\n\t}, 50);\n};\n\n\n\nclass Statistics\n{\n\tconstructor()\n\t{\n\t\tthis.page = {};\n\t\tthis.site = {};\n\t\tthis.resetSite();\n\t}\n\n\tpushResult(link)\n\t{\n\t\tconst result = { displayed:true, link };\n\n\t\tconst hideCachedLink   = logOptions.hideCachedLinks   && link.get(IS_BROKEN)===false && link.get(HTTP_RESPONSE_WAS_CACHED);\n\t\tconst hideSkippedLink  = logOptions.hideSkippedLinks  && link.get(WAS_EXCLUDED);\n\t\tconst hideUnbrokenLink = logOptions.hideUnbrokenLinks && link.get(IS_BROKEN)===false;\n\n\t\tif (hideCachedLink || hideSkippedLink || hideUnbrokenLink)\n\t\t{\n\t\t\tthis.page.hiddenLinks++;\n\t\t\tthis.site.hiddenLinks++;\n\t\t\tresult.displayed = false;\n\t\t}\n\n\t\tif (link.get(IS_BROKEN))\n\t\t{\n\t\t\tthis.page.brokenLinks++;\n\t\t\tthis.site.brokenLinks++;\n\t\t\tprocess.exitCode = 1;\n\t\t}\n\t\telse if (link.get(WAS_EXCLUDED))\n\t\t{\n\t\t\tthis.page.skippedLinks++;\n\t\t\tthis.site.skippedLinks++;\n\t\t}\n\n\t\tthis.page.totalLinks++;\n\t\tthis.site.totalLinks++;\n\n\t\tif (logOptions.maintainLinkOrder)\n\t\t{\n\t\t\tthis.page.results[link.get(HTML_INDEX)] = result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.page.results.push(result);\n\t\t}\n\t}\n\n\tresetPage()\n\t{\n\t\tthis.page.brokenLinks = 0;\n\t\tthis.page.currentIndex = 0;\n\t\tthis.page.hiddenLinks = 0;\n\t\tthis.page.results = [];\n\t\tthis.page.skippedLinks = 0;\n\t\t//this.page.startTime = Date.now();\n\t\tthis.page.totalLinks = 0;\n\t}\n\n\tresetSite()\n\t{\n\t\tthis.resetPage();\n\t\tthis.site.brokenLinks = 0;\n\t\tthis.site.hiddenLinks = 0;\n\t\tthis.site.skippedLinks = 0;\n\t\tthis.site.startTime = Date.now();\n\t\tthis.site.totalLinks = 0;\n\t\tthis.site.totalPages = 0;\n\t}\n}\n\n\n\nconst togglePause = pause =>\n{\n\tif (pause === undefined)\n\t{\n\t\tpause = !checker.isPaused;\n\t}\n\n\tif (pause)\n\t{\n\t\tchecker.pause();\n\n\t\tpauseMessage = `${yellow(\"PAUSED\")}${gray(\" — press space to resume\")}`;\n\t\tgauge.pulse(pauseMessage);\n\t\tclearTimeout(spinner);\n\t}\n\telse\n\t{\n\t\tchecker.resume();\n\n\t\tpauseMessage = gray(\"press space to pause\");\n\t\tspinner = spinnerInterval();\n\t}\n\n\tlogProgress();\n};\n\n\n\nexport default (args=process.argv) =>\n{\n\tconst filterLevel =\n\t[\n\t\t\"--filter-level:\",\n\t\t\"  0: clickable links\",\n\t\t\"  1: 0 + media, frames, meta refreshes\",\n\t\t\"  2: 1 + stylesheets, scripts, forms\",\n\t\t\"  3: 2 + metadata\"\n\t].join(\"\\n\");\n\n\tconst verbosity =\n\t[\n\t\t\"--verbosity:\",\n\t\t\"  0: broken links\",\n\t\t\"  1: 0 + unbroken links\",\n\t\t\"  2: 1 + skipped links\"\n\t].join(\"\\n\");\n\n\t/* eslint-disable sort-keys */\n\tconst optionator = require(\"optionator\")(\n\t{\n\t\tprepend: `${yellow(title.toUpperCase())}\\n\\n${green(\"Usage:\")} blc [options] url1 [url2 ...]`,\n\t\tappend: `${gray(filterLevel)}\\n\\n${gray(verbosity)}\\n`,\n\t\toptions:\n\t\t[\n\t\t\t{ heading:\"Common Options\" },\n\t\t\t{ option:\"recursive\",        alias:\"r\", type:\"Boolean\",  description:`Recursively scan (\"crawl\") the HTML document(s)`,                   default:\"false\" },\n\n\t\t\t{ heading:\"Filtering Options\" },\n\t\t\t{ option:\"exclude\",                     type:\"[String]\", description:\"Skip checking of links that match keywords/glob\" },\n\t\t\t{ option:\"exclude-external\", alias:\"e\", type:\"Boolean\",  description:\"Skip checking of external links\",                                   default:\"false\" },\n\t\t\t{ option:\"exclude-internal\", alias:\"i\", type:\"Boolean\",  description:\"Skip checking of internal links\",                                   default:\"false\" },\n\t\t\t{ option:\"filter-level\",                type:\"Number\",   description:\"Include checking of links by HTML properties\",                      default:`${DEFAULT_OPTIONS.filterLevel}` },\n\t\t\t{ option:\"follow\",           alias:\"f\", type:\"Boolean\",  description:\"Force-follow robot exclusions\",                                     default:\"false\" },\n\t\t\t{ option:\"include\",                     type:\"[String]\", description:\"Only check links that match keywords/glob\" },\n\n\t\t\t{ heading:\"Display Options\" },\n\t\t\t{ option:\"help\",             alias:\"h\", type:\"Boolean\",  description:\"Display this help text\",                                            default:\"false\" },\n\t\t\t{ option:\"ordered\",          alias:\"o\", type:\"Boolean\",  description:\"Maintain the order of links as they appear in their HTML document\", default:\"false\" },\n\t\t\t{ option:\"verbosity\",                   type:\"Number\",   description:\"The display verbosity level\",                                       default:\"1\" },\n\t\t\t{ option:\"version\",          alias:\"v\", type:\"Boolean\",  description:\"Display the app version\",                                           default:\"false\" },\n\n\t\t\t{ heading:\"Advanced Options\" },\n\t\t\t{ option:\"get\",              alias:\"g\", type:\"Boolean\",  description:\"Change request method to GET\",                                      default:\"false\" },\n\t\t\t{ option:\"host-requests\",               type:\"Number\",   description:\"Concurrent requests limit per host\",                                default:`${DEFAULT_OPTIONS.maxSocketsPerHost}` },\n\t\t\t{ option:\"requests\",                    type:\"Number\",   description:\"Concurrent requests limit \",                                        default:`${DEFAULT_OPTIONS.maxSockets}` },\n\t\t\t{ option:\"user-agent\",                  type:\"String\",   description:\"The user agent to use for checking links\" }\n\t\t]\n\t});\n\t/* eslint-disable sort-keys */\n\n\ttry\n\t{\n\t\tif (args === process.argv)\n\t\t{\n\t\t\targs = optionator.parseArgv(args);\n\t\t}\n\t\telse\n\t\t{\n\t\t\targs = optionator.parse(args);\n\t\t}\n\t}\n\tcatch (error)\n\t{\n\t\targs = error;\n\t}\n\n\tif (args instanceof Error)\n\t{\n\t\tconsole.error(args.message);\n\t\tprocess.exitCode = 1;\n\t}\n\telse if (args.help)\n\t{\n\t\tconsole.log( optionator.generateHelp() );\n\t}\n\telse if (args.version)\n\t{\n\t\tconsole.log(packageVersion);\n\t}\n\telse if (args._.length > 0)\n\t{\n\t\turls = args._;\n\t\tcheckerOptions = argsToOptions(args);\n\t\tlogOptions =\n\t\t{\n\t\t\thideCachedLinks:   args.verbosity < 2,\n\t\t\thideSkippedLinks:  args.verbosity < 2,\n\t\t\thideUnbrokenLinks: args.verbosity < 1,\n\t\t\tmaintainLinkOrder: args.ordered,\n\t\t\trecursive:         args.recursive === true  // default value is undefined\n\t\t};\n\n\t\trun();\n\t}\n\telse\n\t{\n\t\tconsole.error(\"At least one URL is required; see '--help'\");\n\t\tprocess.exitCode = 1;\n\t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\ No newline at end of file
diff --git a/lib-cjs/index.js b/lib-cjs/index.js
deleted file mode 100644
index 4ec7bff9..00000000
--- a/lib-cjs/index.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-var _exportNames = {
-  reasons: true,
-  DEFAULT_OPTIONS: true,
-  HtmlChecker: true,
-  HtmlUrlChecker: true,
-  SiteChecker: true,
-  UrlChecker: true
-};
-Object.defineProperty(exports, "DEFAULT_OPTIONS", {
-  enumerable: true,
-  get: function () {
-    return _defaultOptions.default;
-  }
-});
-Object.defineProperty(exports, "HtmlChecker", {
-  enumerable: true,
-  get: function () {
-    return _HtmlChecker.default;
-  }
-});
-Object.defineProperty(exports, "HtmlUrlChecker", {
-  enumerable: true,
-  get: function () {
-    return _HtmlUrlChecker.default;
-  }
-});
-Object.defineProperty(exports, "SiteChecker", {
-  enumerable: true,
-  get: function () {
-    return _SiteChecker.default;
-  }
-});
-Object.defineProperty(exports, "UrlChecker", {
-  enumerable: true,
-  get: function () {
-    return _UrlChecker.default;
-  }
-});
-exports.reasons = void 0;
-var _events = require("./internal/events");
-Object.keys(_events).forEach(function (key) {
-  if (key === "default" || key === "__esModule") return;
-  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
-  if (key in exports && exports[key] === _events[key]) return;
-  Object.defineProperty(exports, key, {
-    enumerable: true,
-    get: function () {
-      return _events[key];
-    }
-  });
-});
-var _reasons = _interopRequireWildcard(require("./internal/reasons"));
-exports.reasons = _reasons;
-var _defaultOptions = _interopRequireDefault(require("./internal/defaultOptions"));
-var _HtmlChecker = _interopRequireDefault(require("./public/HtmlChecker"));
-var _HtmlUrlChecker = _interopRequireDefault(require("./public/HtmlUrlChecker"));
-var _SiteChecker = _interopRequireDefault(require("./public/SiteChecker"));
-var _UrlChecker = _interopRequireDefault(require("./public/UrlChecker"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/lib-cjs/index.js.map b/lib-cjs/index.js.map
deleted file mode 100644
index 5c0ac433..00000000
--- a/lib-cjs/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","names":["_events","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_reasons","_interopRequireWildcard","reasons","_defaultOptions","_interopRequireDefault","_HtmlChecker","_HtmlUrlChecker","_SiteChecker","_UrlChecker","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["../lib/index.js"],"sourcesContent":["export * from \"./internal/events\";\nexport * as reasons from \"./internal/reasons\";\n\n// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as DEFAULT_OPTIONS} from \"./internal/defaultOptions\";\nexport {default as HtmlChecker} from \"./public/HtmlChecker\";\nexport {default as HtmlUrlChecker} from \"./public/HtmlUrlChecker\";\nexport {default as SiteChecker} from \"./public/SiteChecker\";\nexport {default as UrlChecker} from \"./public/UrlChecker\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IA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AA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAjB,GAAA,CAAAc,CAAA,OAAAK,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAhC,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAiC,wBAAA,WAAAC,CAAA,IAAAT,CAAA,oBAAAS,CAAA,IAAAlC,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAmB,CAAA,EAAAS,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAhC,MAAA,CAAAiC,wBAAA,CAAAR,CAAA,EAAAS,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAxB,GAAA,IAAAwB,CAAA,CAAAC,GAAA,IAAApC,MAAA,CAAAS,cAAA,CAAAqB,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAT,CAAA,CAAAS,CAAA,YAAAJ,CAAA,CAAAP,OAAA,GAAAE,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAQ,GAAA,CAAAX,CAAA,EAAAK,CAAA,GAAAA,CAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/Link.js b/lib-cjs/internal/Link.js
deleted file mode 100644
index 6f87b915..00000000
--- a/lib-cjs/internal/Link.js
+++ /dev/null
@@ -1,232 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = exports.WAS_EXCLUDED = exports.RESOLVED_URL = exports.RESOLVED_BASE_URL = exports.REDIRECTED_URL = exports.REBASED_URL = exports.REBASED_BASE_URL = exports.ORIGINAL_URL = exports.IS_SAME_PAGE = exports.IS_INTERNAL = exports.IS_BROKEN = exports.HTTP_RESPONSE_WAS_CACHED = exports.HTTP_RESPONSE = exports.HTML_TEXT = exports.HTML_TAG_NAME = exports.HTML_TAG = exports.HTML_SELECTOR = exports.HTML_OFFSET_INDEX = exports.HTML_LOCATION = exports.HTML_INDEX = exports.HTML_BASE_HREF = exports.HTML_ATTR_NAME = exports.HTML_ATTRS = exports.EXCLUDED_REASON = exports.BROKEN_REASON = void 0;
-var reasons = _interopRequireWildcard(require("./reasons"));
-var _isurl = _interopRequireDefault(require("isurl"));
-var _urlRelation = _interopRequireDefault(require("url-relation"));
-var _class;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
-function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
-function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
-function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
-function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
-const ORIGINAL_URL = exports.ORIGINAL_URL = "originalURL"; // The URL string as it was inputted
-const RESOLVED_URL = exports.RESOLVED_URL = "resolvedURL"; // The `URL`, resolved with `RESOLVED_BASE_URL`
-const REBASED_URL = exports.REBASED_URL = "rebasedURL"; // The `URL`, resolved with `REBASED_BASE_URL`
-const REDIRECTED_URL = exports.REDIRECTED_URL = "redirectedURL"; // The `URL`, after its last redirection, if any
-
-const RESOLVED_BASE_URL = exports.RESOLVED_BASE_URL = "resolvedBaseURL"; // The base `URL`
-const REBASED_BASE_URL = exports.REBASED_BASE_URL = "rebasedBaseURL"; // The base `URL`, resolved with `HTML_BASE_HREF`
-
-const HTML_INDEX = exports.HTML_INDEX = "htmlIndex"; // The order in which the link appeared in its document -- out of all links using max-level tag filter
-const HTML_OFFSET_INDEX = exports.HTML_OFFSET_INDEX = "htmlOffsetIndex"; // Sequential (gap-free) indices for skipped and unskipped links
-const HTML_LOCATION = exports.HTML_LOCATION = "htmlLocation"; // Source code location of the attribute that the link was found within
-const HTML_SELECTOR = exports.HTML_SELECTOR = "htmlSelector"; // CSS selector for element in document
-const HTML_TAG_NAME = exports.HTML_TAG_NAME = "htmlTagName"; // Tag name that the link was found on
-const HTML_ATTR_NAME = exports.HTML_ATTR_NAME = "htmlAttrName"; // Attribute name that the link was found within
-const HTML_ATTRS = exports.HTML_ATTRS = "htmlAttrs"; // All attributes on the element
-const HTML_TEXT = exports.HTML_TEXT = "htmlText"; // TextNodes/innerText of the element
-const HTML_TAG = exports.HTML_TAG = "htmlTag"; // The entire tag string
-const HTML_BASE_HREF = exports.HTML_BASE_HREF = "htmlBaseHref"; // The document's `` value
-
-const HTTP_RESPONSE = exports.HTTP_RESPONSE = "httpResponse"; // The request response
-const HTTP_RESPONSE_WAS_CACHED = exports.HTTP_RESPONSE_WAS_CACHED = "httpResponseWasCached"; // If the response was from cache
-
-const IS_BROKEN = exports.IS_BROKEN = "isBroken"; // If the link was determined to be broken or not
-const IS_INTERNAL = exports.IS_INTERNAL = "isInternal"; // If the link is to the same host as its base/document
-const IS_SAME_PAGE = exports.IS_SAME_PAGE = "isSamePage"; // If the link is to the same page as its base/document
-const WAS_EXCLUDED = exports.WAS_EXCLUDED = "wasExcluded"; // If the link was excluded due to any filtering
-
-const BROKEN_REASON = exports.BROKEN_REASON = "brokenReason"; // The reason why the link was considered broken, if it indeed is
-const EXCLUDED_REASON = exports.EXCLUDED_REASON = "excludedReason"; // The reason why the link was excluded from being checked, if it indeed was
-var _relateWithBase = /*#__PURE__*/new WeakSet();
-class Link extends Map {
-  /**
-   * @param {Link} [link]
-   */
-  constructor(link) {
-    super(link);
-    /**
-     * Reassign properties associated with state relative to the link's environment.
-     */
-    _classPrivateMethodInitSpec(this, _relateWithBase);
-    if (!(link instanceof Link)) {
-      // Default values
-      keys.forEach(key => super.set(key, null));
-    }
-  }
-
-  /**
-   * Change state to "broken" with a reason.
-   * @param {string} reasonKey
-   * @returns {Link}
-   */
-  break(reasonKey) {
-    if (!(reasonKey in reasons)) {
-      reasonKey = "BLC_UNKNOWN";
-    }
-    super.set(IS_BROKEN, true);
-    super.set(BROKEN_REASON, reasonKey);
-    this.include();
-    return this;
-  }
-
-  /**
-   * Change state to "excluded" with a reason.
-   * @param {string} reasonKey
-   * @returns {Link}
-   */
-  exclude(reasonKey) {
-    super.set(WAS_EXCLUDED, true);
-    super.set(EXCLUDED_REASON, reasonKey);
-    return this;
-  }
-
-  /**
-   * Change state to "not excluded" and remove any previous reason for being otherwise.
-   * @returns {Link}
-   */
-  include() {
-    super.set(WAS_EXCLUDED, false);
-    super.set(EXCLUDED_REASON, null);
-    return this;
-  }
-
-  /**
-   * Change state to "not broken" and remove any previous reason for being otherwise.
-   * @returns {Link}
-   */
-  mend() {
-    super.set(IS_BROKEN, false);
-    super.set(BROKEN_REASON, null);
-    this.include();
-    return this;
-  }
-
-  /**
-   * Assign a redirected URL and change any relative state.
-   * @param {URL|string} url
-   * @returns {Link}
-   */
-  redirect(url) {
-    super.set(REDIRECTED_URL, parseURL(url));
-    _classPrivateMethodGet(this, _relateWithBase, _relateWithBase2).call(this);
-    return this;
-  }
-  /**
-   * Produce and assign an absolute URL and change any relative state.
-   * @param {URL|string|null} [url]
-   * @param {URL|string|null} [base]
-   * @returns {Link}
-   */
-  resolve(url, base) {
-    if (url != null) {
-      // Parse or clone
-      base = parseURL(base);
-      if ((0, _isurl.default)(url)) {
-        super.set(ORIGINAL_URL, url.href);
-        super.set(RESOLVED_URL, url);
-      } else {
-        super.set(ORIGINAL_URL, url);
-        super.set(RESOLVED_URL, parseURL(url));
-      }
-      if (base !== null) {
-        // Remove any hash since it's useless in a base -- safe to mutate
-        base.hash = "";
-        const rebased = parseURL(super.get(HTML_BASE_HREF), base);
-        super.set(REBASED_BASE_URL, rebased ?? base);
-        super.set(RESOLVED_BASE_URL, base);
-      } else {
-        super.set(REBASED_BASE_URL, parseURL(super.get(HTML_BASE_HREF)));
-      }
-      if (super.get(REBASED_BASE_URL) !== null) {
-        // Remove any hash since it's useless in a base -- safe to mutate
-        super.get(REBASED_BASE_URL).hash = "";
-        if (super.get(RESOLVED_URL) === null) {
-          super.set(RESOLVED_URL, parseURL(url, super.get(RESOLVED_BASE_URL)));
-          super.set(REBASED_URL, parseURL(url, super.get(REBASED_BASE_URL)));
-        } else {
-          super.set(REBASED_URL, super.get(RESOLVED_URL));
-        }
-      } else {
-        super.set(REBASED_URL, super.get(RESOLVED_URL));
-      }
-
-      // @todo move relation stuff out of this function -- separation of concerns?
-      _classPrivateMethodGet(this, _relateWithBase, _relateWithBase2).call(this);
-    }
-    return this;
-  }
-
-  /**
-   * Assign a value to a supported key.
-   * @param {symbol} key
-   * @param {*} value
-   * @throws {TypeError} unsupported key or undefined value
-   * @returns {Link}
-   */
-  set(key, value) {
-    if (!keys.includes(key)) {
-      throw new TypeError("Invalid key");
-    } else if (value === undefined) {
-      throw new TypeError("Invalid value");
-    } else {
-      return super.set(key, value);
-    }
-  }
-
-  /**
-   * Produce a key-value object for `JSON.stringify()`.
-   * @returns {object}
-   */
-  toJSON() {
-    // @todo https://github.com/tc39/proposal-pipeline-operator
-    return Object.fromEntries(Array.from(super.entries()));
-  }
-}
-exports.default = Link;
-_class = Link;
-function _relateWithBase2() {
-  const url = _get(_getPrototypeOf(_class.prototype), "get", this).call(this, REDIRECTED_URL) ?? _get(_getPrototypeOf(_class.prototype), "get", this).call(this, REBASED_URL);
-
-  // If impossible to determine is linked to same server/etc
-  if (url === null || _get(_getPrototypeOf(_class.prototype), "get", this).call(this, RESOLVED_BASE_URL) === null) {
-    // Overwrite any previous values
-    _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_INTERNAL, null);
-    _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_SAME_PAGE, null);
-  } else {
-    // Rebased base URL not used because `` URL could be remote
-    // @todo common/careful profile
-    // @todo auth shouldn't affect this
-    const relation = new _urlRelation.default(url, _get(_getPrototypeOf(_class.prototype), "get", this).call(this, RESOLVED_BASE_URL));
-    _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_INTERNAL, relation.upTo(_urlRelation.default.HOST));
-    _get(_getPrototypeOf(_class.prototype), "set", this).call(this, IS_SAME_PAGE, relation.upTo(_urlRelation.default.PATH));
-  }
-}
-const keys = [BROKEN_REASON, EXCLUDED_REASON, HTML_ATTR_NAME, HTML_ATTRS, HTML_BASE_HREF, HTML_INDEX, HTML_LOCATION, HTML_OFFSET_INDEX, HTML_SELECTOR, HTML_TAG, HTML_TAG_NAME, HTML_TEXT, HTTP_RESPONSE, HTTP_RESPONSE_WAS_CACHED, IS_BROKEN, IS_INTERNAL, IS_SAME_PAGE, ORIGINAL_URL, REBASED_BASE_URL, REBASED_URL, REDIRECTED_URL, RESOLVED_BASE_URL, RESOLVED_URL, WAS_EXCLUDED];
-
-/**
- * Parse or clone a URL.
- * @param {URL|string|null} [url]
- * @param {URL|string|null} [base]
- * @returns {URL|null}
- */
-const parseURL = (url = null, base) => {
-  if (url !== null) {
-    try {
-      url = new URL(url, base);
-    } catch {
-      url = null;
-    }
-  }
-  return url;
-};
-Object.freeze(Link);
-//# sourceMappingURL=Link.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/Link.js.map b/lib-cjs/internal/Link.js.map
deleted file mode 100644
index cff10a78..00000000
--- a/lib-cjs/internal/Link.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"Link.js","names":["reasons","_interopRequireWildcard","require","_isurl","_interopRequireDefault","_urlRelation","_class","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","privateCollection","TypeError","_get","Reflect","bind","target","property","receiver","base","_superPropBase","desc","arguments","length","value","apply","object","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","_classPrivateMethodGet","fn","ORIGINAL_URL","exports","RESOLVED_URL","REBASED_URL","REDIRECTED_URL","RESOLVED_BASE_URL","REBASED_BASE_URL","HTML_INDEX","HTML_OFFSET_INDEX","HTML_LOCATION","HTML_SELECTOR","HTML_TAG_NAME","HTML_ATTR_NAME","HTML_ATTRS","HTML_TEXT","HTML_TAG","HTML_BASE_HREF","HTTP_RESPONSE","HTTP_RESPONSE_WAS_CACHED","IS_BROKEN","IS_INTERNAL","IS_SAME_PAGE","WAS_EXCLUDED","BROKEN_REASON","EXCLUDED_REASON","_relateWithBase","WeakSet","Link","Map","constructor","link","keys","forEach","key","break","reasonKey","include","exclude","mend","redirect","url","parseURL","_relateWithBase2","resolve","isURL","href","hash","rebased","includes","undefined","toJSON","fromEntries","Array","from","entries","relation","URLRelation","upTo","HOST","PATH","URL","freeze"],"sources":["../../lib/internal/Link.js"],"sourcesContent":["import * as reasons from \"./reasons\";\nimport isURL from \"isurl\";\nimport URLRelation from \"url-relation\";\n\n\n\nexport const ORIGINAL_URL = \"originalURL\";      // The URL string as it was inputted\nexport const RESOLVED_URL = \"resolvedURL\";      // The `URL`, resolved with `RESOLVED_BASE_URL`\nexport const REBASED_URL = \"rebasedURL\";        // The `URL`, resolved with `REBASED_BASE_URL`\nexport const REDIRECTED_URL = \"redirectedURL\";  // The `URL`, after its last redirection, if any\n\nexport const RESOLVED_BASE_URL = \"resolvedBaseURL\";  // The base `URL`\nexport const REBASED_BASE_URL = \"rebasedBaseURL\";    // The base `URL`, resolved with `HTML_BASE_HREF`\n\nexport const HTML_INDEX = \"htmlIndex\";               // The order in which the link appeared in its document -- out of all links using max-level tag filter\nexport const HTML_OFFSET_INDEX = \"htmlOffsetIndex\";  // Sequential (gap-free) indices for skipped and unskipped links\nexport const HTML_LOCATION = \"htmlLocation\";         // Source code location of the attribute that the link was found within\nexport const HTML_SELECTOR = \"htmlSelector\";         // CSS selector for element in document\nexport const HTML_TAG_NAME = \"htmlTagName\";          // Tag name that the link was found on\nexport const HTML_ATTR_NAME = \"htmlAttrName\";        // Attribute name that the link was found within\nexport const HTML_ATTRS = \"htmlAttrs\";               // All attributes on the element\nexport const HTML_TEXT = \"htmlText\";                 // TextNodes/innerText of the element\nexport const HTML_TAG = \"htmlTag\";                   // The entire tag string\nexport const HTML_BASE_HREF = \"htmlBaseHref\";        // The document's `` value\n\nexport const HTTP_RESPONSE = \"httpResponse\";                      // The request response\nexport const HTTP_RESPONSE_WAS_CACHED = \"httpResponseWasCached\";  // If the response was from cache\n\nexport const IS_BROKEN = \"isBroken\";        // If the link was determined to be broken or not\nexport const IS_INTERNAL = \"isInternal\";    // If the link is to the same host as its base/document\nexport const IS_SAME_PAGE = \"isSamePage\";   // If the link is to the same page as its base/document\nexport const WAS_EXCLUDED = \"wasExcluded\";  // If the link was excluded due to any filtering\n\nexport const BROKEN_REASON = \"brokenReason\";      // The reason why the link was considered broken, if it indeed is\nexport const EXCLUDED_REASON = \"excludedReason\";  // The reason why the link was excluded from being checked, if it indeed was\n\n\n\nexport default class Link extends Map\n{\n\t/**\n\t * @param {Link} [link]\n\t */\n\tconstructor(link)\n\t{\n\t\tsuper(link);\n\n\t\tif (!(link instanceof Link))\n\t\t{\n\t\t\t// Default values\n\t\t\tkeys.forEach(key => super.set(key, null));\n\t\t}\n\t}\n\n\n\t/**\n\t * Change state to \"broken\" with a reason.\n\t * @param {string} reasonKey\n\t * @returns {Link}\n\t */\n\tbreak(reasonKey)\n\t{\n\t\tif (!(reasonKey in reasons))\n\t\t{\n\t\t\treasonKey = \"BLC_UNKNOWN\";\n\t\t}\n\n\t\tsuper.set(IS_BROKEN, true);\n\t\tsuper.set(BROKEN_REASON, reasonKey);\n\t\tthis.include();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"excluded\" with a reason.\n\t * @param {string} reasonKey\n\t * @returns {Link}\n\t */\n\texclude(reasonKey)\n\t{\n\t\tsuper.set(WAS_EXCLUDED, true);\n\t\tsuper.set(EXCLUDED_REASON, reasonKey);\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"not excluded\" and remove any previous reason for being otherwise.\n\t * @returns {Link}\n\t */\n\tinclude()\n\t{\n\t\tsuper.set(WAS_EXCLUDED, false);\n\t\tsuper.set(EXCLUDED_REASON, null);\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Change state to \"not broken\" and remove any previous reason for being otherwise.\n\t * @returns {Link}\n\t */\n\tmend()\n\t{\n\t\tsuper.set(IS_BROKEN, false);\n\t\tsuper.set(BROKEN_REASON, null);\n\t\tthis.include();\n\t\treturn this;\n\t}\n\n\n\t/**\n\t * Assign a redirected URL and change any relative state.\n\t * @param {URL|string} url\n\t * @returns {Link}\n\t */\n\tredirect(url)\n\t{\n\t\tsuper.set(REDIRECTED_URL, parseURL(url));\n\n\t\tthis.#relateWithBase();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Reassign properties associated with state relative to the link's environment.\n\t */\n\t#relateWithBase()\n\t{\n\t\tconst url = super.get(REDIRECTED_URL) ?? super.get(REBASED_URL);\n\n\t\t// If impossible to determine is linked to same server/etc\n\t\tif (url===null || super.get(RESOLVED_BASE_URL)===null)\n\t\t{\n\t\t\t// Overwrite any previous values\n\t\t\tsuper.set(IS_INTERNAL, null);\n\t\t\tsuper.set(IS_SAME_PAGE, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Rebased base URL not used because `` URL could be remote\n\t\t\t// @todo common/careful profile\n\t\t\t// @todo auth shouldn't affect this\n\t\t\tconst relation = new URLRelation(url, super.get(RESOLVED_BASE_URL));\n\n\t\t\tsuper.set(IS_INTERNAL,  relation.upTo(URLRelation.HOST));\n\t\t\tsuper.set(IS_SAME_PAGE, relation.upTo(URLRelation.PATH));\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Produce and assign an absolute URL and change any relative state.\n\t * @param {URL|string|null} [url]\n\t * @param {URL|string|null} [base]\n\t * @returns {Link}\n\t */\n\tresolve(url, base)\n\t{\n\t\tif (url != null)\n\t\t{\n\t\t\t// Parse or clone\n\t\t\tbase = parseURL(base);\n\n\t\t\tif (isURL(url))\n\t\t\t{\n\t\t\t\tsuper.set(ORIGINAL_URL, url.href);\n\t\t\t\tsuper.set(RESOLVED_URL, url);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(ORIGINAL_URL, url);\n\t\t\t\tsuper.set(RESOLVED_URL, parseURL(url));\n\t\t\t}\n\n\t\t\tif (base !== null)\n\t\t\t{\n\t\t\t\t// Remove any hash since it's useless in a base -- safe to mutate\n\t\t\t\tbase.hash = \"\";\n\n\t\t\t\tconst rebased = parseURL(super.get(HTML_BASE_HREF), base);\n\n\t\t\t\tsuper.set(REBASED_BASE_URL, rebased ?? base);\n\t\t\t\tsuper.set(RESOLVED_BASE_URL, base);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(REBASED_BASE_URL, parseURL(super.get(HTML_BASE_HREF)));\n\t\t\t}\n\n\t\t\tif (super.get(REBASED_BASE_URL) !== null)\n\t\t\t{\n\t\t\t\t// Remove any hash since it's useless in a base -- safe to mutate\n\t\t\t\tsuper.get(REBASED_BASE_URL).hash = \"\";\n\n\t\t\t\tif (super.get(RESOLVED_URL) === null)\n\t\t\t\t{\n\t\t\t\t\tsuper.set(RESOLVED_URL, parseURL(url, super.get(RESOLVED_BASE_URL)));\n\t\t\t\t\tsuper.set(REBASED_URL,  parseURL(url, super.get(REBASED_BASE_URL)));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuper.set(REBASED_URL, super.get(RESOLVED_URL));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.set(REBASED_URL, super.get(RESOLVED_URL));\n\t\t\t}\n\n\t\t\t// @todo move relation stuff out of this function -- separation of concerns?\n\t\t\tthis.#relateWithBase();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Assign a value to a supported key.\n\t * @param {symbol} key\n\t * @param {*} value\n\t * @throws {TypeError} unsupported key or undefined value\n\t * @returns {Link}\n\t */\n\tset(key, value)\n\t{\n\t\tif (!keys.includes(key))\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid key\");\n\t\t}\n\t\telse if (value === undefined)\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid value\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn super.set(key, value);\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Produce a key-value object for `JSON.stringify()`.\n\t * @returns {object}\n\t */\n\ttoJSON()\n\t{\n\t\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t\treturn Object.fromEntries(Array.from(super.entries()));\n\t}\n}\n\n\n\nconst keys =\n[\n\tBROKEN_REASON,\n\tEXCLUDED_REASON,\n\tHTML_ATTR_NAME,\n\tHTML_ATTRS,\n\tHTML_BASE_HREF,\n\tHTML_INDEX,\n\tHTML_LOCATION,\n\tHTML_OFFSET_INDEX,\n\tHTML_SELECTOR,\n\tHTML_TAG,\n\tHTML_TAG_NAME,\n\tHTML_TEXT,\n\tHTTP_RESPONSE,\n\tHTTP_RESPONSE_WAS_CACHED,\n\tIS_BROKEN,\n\tIS_INTERNAL,\n\tIS_SAME_PAGE,\n\tORIGINAL_URL,\n\tREBASED_BASE_URL,\n\tREBASED_URL,\n\tREDIRECTED_URL,\n\tRESOLVED_BASE_URL,\n\tRESOLVED_URL,\n\tWAS_EXCLUDED\n];\n\n\n\n/**\n * Parse or clone a URL.\n * @param {URL|string|null} [url]\n * @param {URL|string|null} [base]\n * @returns {URL|null}\n */\nconst parseURL = (url=null, base) =>\n{\n\tif (url !== null)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = new URL(url, base);\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\turl = null;\n\t\t}\n\t}\n\n\treturn url;\n};\n\n\n\nObject.freeze(Link);\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAuC,IAAAI,MAAA;AAAA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,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AA,CAAA3C,MAAA,CAAAkB,SAAA,gBAAAE,IAAA,OAAUkD,YAAY,EAAEkC,QAAQ,CAACE,IAAI,CAACD,oBAAW,CAACG,IAAI,CAAC;EACxD;AACD;AA8GD,MAAM5B,IAAI,GACV,CACCR,aAAa,EACbC,eAAe,EACfZ,cAAc,EACdC,UAAU,EACVG,cAAc,EACdT,UAAU,EACVE,aAAa,EACbD,iBAAiB,EACjBE,aAAa,EACbK,QAAQ,EACRJ,aAAa,EACbG,SAAS,EACTG,aAAa,EACbC,wBAAwB,EACxBC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZrB,YAAY,EACZM,gBAAgB,EAChBH,WAAW,EACXC,cAAc,EACdC,iBAAiB,EACjBH,YAAY,EACZoB,YAAY,CACZ;;AAID;AACA;AACA;AACA;AACA;AACA;AACA,MAAMmB,QAAQ,GAAGA,CAACD,GAAG,GAAC,IAAI,EAAEtD,IAAI,KAChC;EACC,IAAIsD,GAAG,KAAK,IAAI,EAChB;IACC,IACA;MACCA,GAAG,GAAG,IAAIoB,GAAG,CAACpB,GAAG,EAAEtD,IAAI,CAAC;IACzB,CAAC,CACD,MACA;MACCsD,GAAG,GAAG,IAAI;IACX;EACD;EAEA,OAAOA,GAAG;AACX,CAAC;AAID3E,MAAM,CAACgG,MAAM,CAAClC,IAAI,CAAC"}
\ No newline at end of file
diff --git a/lib-cjs/internal/SafeEventEmitter.js b/lib-cjs/internal/SafeEventEmitter.js
deleted file mode 100644
index f842baf8..00000000
--- a/lib-cjs/internal/SafeEventEmitter.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _events = require("../internal/events");
-var _events2 = require("events");
-class SafeEventEmitter extends _events2.EventEmitter {
-  /**
-   * Emit an event while catching any errors within consumer handlers.
-   * @param {string} type
-   * @param {...*} args
-   */
-  emit(type, ...args) {
-    try {
-      super.emit(type, ...args);
-    } catch (error) {
-      super.emit(_events.ERROR_EVENT, error);
-    }
-  }
-}
-exports.default = SafeEventEmitter;
-module.exports = exports.default;
-//# sourceMappingURL=SafeEventEmitter.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/SafeEventEmitter.js.map b/lib-cjs/internal/SafeEventEmitter.js.map
deleted file mode 100644
index 1eb4984f..00000000
--- a/lib-cjs/internal/SafeEventEmitter.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"SafeEventEmitter.js","names":["_events","require","_events2","SafeEventEmitter","EventEmitter","emit","type","args","error","ERROR_EVENT","exports","default","module"],"sources":["../../lib/internal/SafeEventEmitter.js"],"sourcesContent":["import {ERROR_EVENT} from \"../internal/events\";\nimport {EventEmitter} from \"events\";\n\n\n\nexport default class SafeEventEmitter extends EventEmitter\n{\n\t/**\n\t * Emit an event while catching any errors within consumer handlers.\n\t * @param {string} type\n\t * @param {...*} args\n\t */\n\temit(type, ...args)\n\t{\n\t\ttry\n\t\t{\n\t\t\tsuper.emit(type, ...args);\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\tsuper.emit(ERROR_EVENT, error);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIe,MAAME,gBAAgB,SAASC,qBAAY,CAC1D;EACC;AACD;AACA;AACA;AACA;EACCC,IAAIA,CAACC,IAAI,EAAE,GAAGC,IAAI,EAClB;IACC,IACA;MACC,KAAK,CAACF,IAAI,CAACC,IAAI,EAAE,GAAGC,IAAI,CAAC;IAC1B,CAAC,CACD,OAAOC,KAAK,EACZ;MACC,KAAK,CAACH,IAAI,CAACI,mBAAW,EAAED,KAAK,CAAC;IAC/B;EACD;AACD;AAACE,OAAA,CAAAC,OAAA,GAAAR,gBAAA;AAAAS,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/checkLink.js b/lib-cjs/internal/checkLink.js
deleted file mode 100644
index 43e66018..00000000
--- a/lib-cjs/internal/checkLink.js
+++ /dev/null
@@ -1,69 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var reasons = _interopRequireWildcard(require("./reasons"));
-var _fileProtocol = require("./file-protocol");
-var _httpProtocol = require("./http-protocol");
-var _isString = _interopRequireDefault(require("is-string"));
-var _Link = _interopRequireWildcard(require("./Link"));
-var _matchURL = _interopRequireDefault(require("./matchURL"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-/**
- * Check a link's URL to see if it is broken or not.
- * @param {Link} link
- * @param {object} auth
- * @param {URLCache} cache
- * @param {object} options
- * @throws {TypeError} non-Link
- * @returns {Promise}
- */
-var _default = async (link, auth, cache, options) => {
-  if (!(link instanceof _Link.default)) {
-    throw new TypeError("Invalid Link");
-  } else {
-    const {
-      excludedKeywords,
-      includedKeywords,
-      includeLink
-    } = options;
-    const rebasedURL = link.get(_Link.REBASED_URL);
-    if (rebasedURL === null) {
-      link.break("BLC_INVALID");
-      return link;
-    } else if (!(0, _fileProtocol.isCompatibleScheme)(rebasedURL) && !(0, _httpProtocol.isCompatibleScheme)(rebasedURL)) {
-      link.exclude("BLC_UNSUPPORTED");
-      return link;
-    } else if ((0, _matchURL.default)(rebasedURL.href, excludedKeywords)) {
-      link.exclude("BLC_KEYWORD");
-      return link;
-    } else if (includedKeywords.length > 0 && !(0, _matchURL.default)(rebasedURL.href, includedKeywords)) {
-      link.exclude("BLC_KEYWORD");
-      return link;
-    } else {
-      const filterResult = includeLink(link);
-
-      // Undocumented support for strings (from `SiteChecker`)
-      if ((0, _isString.default)(filterResult) && filterResult in reasons) {
-        link.exclude(filterResult);
-        return link;
-      } else if (!filterResult) {
-        link.exclude("BLC_CUSTOM");
-        return link;
-      } else {
-        if ((0, _fileProtocol.isCompatibleScheme)(rebasedURL)) {
-          return (0, _fileProtocol.checkLink)(link);
-        } else if ((0, _httpProtocol.isCompatibleScheme)(rebasedURL)) {
-          return (0, _httpProtocol.checkLink)(link, auth, cache, options);
-        }
-      }
-    }
-  }
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=checkLink.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/checkLink.js.map b/lib-cjs/internal/checkLink.js.map
deleted file mode 100644
index ad252250..00000000
--- a/lib-cjs/internal/checkLink.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"checkLink.js","names":["reasons","_interopRequireWildcard","require","_fileProtocol","_httpProtocol","_isString","_interopRequireDefault","_Link","_matchURL","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_default","link","auth","cache","options","Link","TypeError","excludedKeywords","includedKeywords","includeLink","rebasedURL","REBASED_URL","break","isFileScheme","isHTTPScheme","exclude","matchURL","href","length","filterResult","isString","checkFileLink","checkHTTPLink","exports","module"],"sources":["../../lib/internal/checkLink.js"],"sourcesContent":["import * as reasons from \"./reasons\";\nimport {checkLink as checkFileLink, isCompatibleScheme as isFileScheme} from \"./file-protocol\";\nimport {checkLink as checkHTTPLink, isCompatibleScheme as isHTTPScheme} from \"./http-protocol\";\nimport isString from \"is-string\";\nimport Link, {REBASED_URL} from \"./Link\";\nimport matchURL from \"./matchURL\";\n\n\n\n/**\n * Check a link's URL to see if it is broken or not.\n * @param {Link} link\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-Link\n * @returns {Promise}\n */\nexport default async (link, auth, cache, options) =>\n{\n\tif (!(link instanceof Link))\n\t{\n\t\tthrow new TypeError(\"Invalid Link\");\n\t}\n\telse\n\t{\n\t\tconst {excludedKeywords, includedKeywords, includeLink} = options;\n\t\tconst rebasedURL = link.get(REBASED_URL);\n\n\t\tif (rebasedURL === null)\n\t\t{\n\t\t\tlink.break(\"BLC_INVALID\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (!isFileScheme(rebasedURL) && !isHTTPScheme(rebasedURL))\n\t\t{\n\t\t\tlink.exclude(\"BLC_UNSUPPORTED\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (matchURL(rebasedURL.href, excludedKeywords))\n\t\t{\n\t\t\tlink.exclude(\"BLC_KEYWORD\");\n\t\t\treturn link;\n\t\t}\n\t\telse if (includedKeywords.length>0 && !matchURL(rebasedURL.href, includedKeywords))\n\t\t{\n\t\t\tlink.exclude(\"BLC_KEYWORD\");\n\t\t\treturn link;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst filterResult = includeLink(link);\n\n\t\t\t// Undocumented support for strings (from `SiteChecker`)\n\t\t\tif (isString(filterResult) && filterResult in reasons)\n\t\t\t{\n\t\t\t\tlink.exclude(filterResult);\n\t\t\t\treturn link;\n\t\t\t}\n\t\t\telse if (!filterResult)\n\t\t\t{\n\t\t\t\tlink.exclude(\"BLC_CUSTOM\");\n\t\t\t\treturn link;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (isFileScheme(rebasedURL))\n\t\t\t\t{\n\t\t\t\t\treturn checkFileLink(link);\n\t\t\t\t}\n\t\t\t\telse if (isHTTPScheme(rebasedURL))\n\t\t\t\t{\n\t\t\t\t\tretur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AAET,gBAAgB,CAAC,EAClF;MACCP,IAAI,CAACc,OAAO,CAAC,aAAa,CAAC;MAC3B,OAAOd,IAAI;IACZ,CAAC,MAED;MACC,MAAMkB,YAAY,GAAGV,WAAW,CAACR,IAAI,CAAC;;MAEtC;MACA,IAAI,IAAAmB,iBAAQ,EAACD,YAAY,CAAC,IAAIA,YAAY,IAAIlD,OAAO,EACrD;QACCgC,IAAI,CAACc,OAAO,CAACI,YAAY,CAAC;QAC1B,OAAOlB,IAAI;MACZ,CAAC,MACI,IAAI,CAACkB,YAAY,EACtB;QACClB,IAAI,CAACc,OAAO,CAAC,YAAY,CAAC;QAC1B,OAAOd,IAAI;MACZ,CAAC,MAED;QACC,IAAI,IAAAY,gCAAY,EAACH,UAAU,CAAC,EAC5B;UACC,OAAO,IAAAW,uBAAa,EAACpB,IAAI,CAAC;QAC3B,CAAC,MACI,IAAI,IAAAa,gCAAY,EAACJ,UAAU,CAAC,EACjC;UACC,OAAO,IAAAY,uBAAa,EAACrB,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;QACjD;MACD;IACD;EACD;AACD,CAAC;AAAAmB,OAAA,CAAA3C,OAAA,GAAAoB,QAAA;AAAAwB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3C,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/defaultOptions.js b/lib-cjs/internal/defaultOptions.js
deleted file mode 100644
index 998ccb15..00000000
--- a/lib-cjs/internal/defaultOptions.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _deepFreezeNode = _interopRequireDefault(require("deep-freeze-node"));
-var _httpMethodsConstants = require("http-methods-constants");
-var _package = require("../../package.json");
-var _tags = _interopRequireDefault(require("./tags"));
-var _defaultUserAgent = _interopRequireDefault(require("default-user-agent"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-var _default = exports.default = (0, _deepFreezeNode.default)({
-  cacheMaxAge: 3_600_000,
-  cacheResponses: true,
-  excludedKeywords: [],
-  excludeExternalLinks: false,
-  excludeInternalLinks: false,
-  excludeLinksToSamePage: false,
-  filterLevel: 1,
-  honorRobotExclusions: true,
-  includedKeywords: [],
-  includeLink: () => true,
-  includePage: () => true,
-  maxSockets: Infinity,
-  // @todo change to `maxExternalSockets`
-  maxSocketsPerHost: 1,
-  // @todo separate to `maxInternalSockets=5` and `maxExternalSocketsPerHost=1`
-  rateLimit: 0,
-  requestMethod: _httpMethodsConstants.HEAD,
-  retryHeadCodes: [405],
-  retryHeadFail: true,
-  tags: _tags.default,
-  userAgent: (0, _defaultUserAgent.default)(_package.name, _package.version)
-});
-module.exports = exports.default;
-//# sourceMappingURL=defaultOptions.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/defaultOptions.js.map b/lib-cjs/internal/defaultOptions.js.map
deleted file mode 100644
index 35c1f47e..00000000
--- a/lib-cjs/internal/defaultOptions.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"defaultOptions.js","names":["_deepFreezeNode","_interopRequireDefault","require","_httpMethodsConstants","_package","_tags","_defaultUserAgent","obj","__esModule","default","_default","exports","deepFreeze","cacheMaxAge","cacheResponses","excludedKeywords","excludeExternalLinks","excludeInternalLinks","excludeLinksToSamePage","filterLevel","honorRobotExclusions","includedKeywords","includeLink","includePage","maxSockets","Infinity","maxSocketsPerHost","rateLimit","requestMethod","HEAD","retryHeadCodes","retryHeadFail","tags","TAGS","userAgent","packageName","packageVersion","module"],"sources":["../../lib/internal/defaultOptions.js"],"sourcesContent":["import deepFreeze from \"deep-freeze-node\";\nimport {HEAD} from \"http-methods-constants\";\nimport {name as packageName, version as packageVersion} from \"../../package.json\";\nimport TAGS from \"./tags\";\nimport userAgent from \"default-user-agent\";\n\n\n\nexport default deepFreeze(\n{\n\tcacheMaxAge: 3_600_000,\n\tcacheResponses: true,\n\texcludedKeywords: [],\n\texcludeExternalLinks: false,\n\texcludeInternalLinks: false,\n\texcludeLinksToSamePage: false,\n\tfilterLevel: 1,\n\thonorRobotExclusions: true,\n\tincludedKeywords: [],\n\tincludeLink: () => true,\n\tincludePage: () => true,\n\tmaxSockets: Infinity,  // @todo change to `maxExternalSockets`\n\tmaxSocketsPerHost: 1,  // @todo separate to `maxInternalSockets=5` and `maxExternalSocketsPerHost=1`\n\trateLimit: 0,\n\trequestMethod: HEAD,\n\tretryHeadCodes: [405],\n\tretryHeadFail: true,\n\ttags: TAGS,\n\tuserAgent: userAgent(packageName, packageVersion)\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAI5B,IAAAG,uBAAU,EACzB;EACCC,WAAW,EAAE,SAAS;EACtBC,cAAc,EAAE,IAAI;EACpBC,gBAAgB,EAAE,EAAE;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,oBAAoB,EAAE,KAAK;EAC3BC,sBAAsB,EAAE,KAAK;EAC7BC,WAAW,EAAE,CAAC;EACdC,oBAAoB,EAAE,IAAI;EAC1BC,gBAAgB,EAAE,EAAE;EACpBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,UAAU,EAAEC,QAAQ;EAAG;EACvBC,iBAAiB,EAAE,CAAC;EAAG;EACvBC,SAAS,EAAE,CAAC;EACZC,aAAa,EAAEC,0BAAI;EACnBC,cAAc,EAAE,CAAC,GAAG,CAAC;EACrBC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,aAAI;EACVC,SAAS,EAAE,IAAAA,yBAAS,EAACC,aAAW,EAAEC,gBAAc;AACjD,CAAC,CAAC;AAAAC,MAAA,CAAA1B,OAAA,GAAAA,OAAA,CAAAF,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/errors.js b/lib-cjs/internal/errors.js
deleted file mode 100644
index ad227a31..00000000
--- a/lib-cjs/internal/errors.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-Object.defineProperty(exports, "ExpectedHTMLExtensionError", {
-  enumerable: true,
-  get: function () {
-    return _fileProtocol.ExpectedHTMLExtensionError;
-  }
-});
-Object.defineProperty(exports, "ExpectedHTMLMediaTypeError", {
-  enumerable: true,
-  get: function () {
-    return _httpProtocol.ExpectedHTMLMediaTypeError;
-  }
-});
-exports.HTMLRetrievalError = void 0;
-var _fileProtocol = require("./file-protocol");
-var _httpProtocol = require("./http-protocol");
-class HTMLRetrievalError extends Error {
-  /**
-   * @param {number|string} statusCode
-   */
-  constructor(statusCode) {
-    super("HTML could not be retrieved");
-    this.code = statusCode;
-  }
-}
-exports.HTMLRetrievalError = HTMLRetrievalError;
-//# sourceMappingURL=errors.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/errors.js.map b/lib-cjs/internal/errors.js.map
deleted file mode 100644
index f4e7c840..00000000
--- a/lib-cjs/internal/errors.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"errors.js","names":["_fileProtocol","require","_httpProtocol","HTMLRetrievalError","Error","constructor","statusCode","code","exports"],"sources":["../../lib/internal/errors.js"],"sourcesContent":["export {ExpectedHTMLExtensionError} from \"./file-protocol\";\nexport {ExpectedHTMLMediaTypeError} from \"./http-protocol\";\n\nexport class HTMLRetrievalError extends Error\n{\n\t/**\n\t * @param {number|string} statusCode\n\t */\n\tconstructor(statusCode)\n\t{\n\t\tsuper(\"HTML could not be retrieved\");\n\t\tthis.code = statusCode;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,SAASC,KAAK,CAC7C;EACC;AACD;AACA;EACCC,WAAWA,CAACC,UAAU,EACtB;IACC,KAAK,CAAC,6BAA6B,CAAC;IACpC,IAAI,CAACC,IAAI,GAAGD,UAAU;EACvB;AACD;AAACE,OAAA,CAAAL,kBAAA,GAAAA,kBAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/events.js b/lib-cjs/internal/events.js
deleted file mode 100644
index a698ed0f..00000000
--- a/lib-cjs/internal/events.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.SITE_EVENT = exports.ROBOTS_EVENT = exports.QUEUE_EVENT = exports.PAGE_EVENT = exports.LINK_EVENT = exports.JUNK_EVENT = exports.HTML_EVENT = exports.ERROR_EVENT = exports.END_EVENT = exports.COMPLETE_EVENT = void 0;
-const COMPLETE_EVENT = exports.COMPLETE_EVENT = "complete";
-const END_EVENT = exports.END_EVENT = "end";
-const ERROR_EVENT = exports.ERROR_EVENT = "error";
-const HTML_EVENT = exports.HTML_EVENT = "html";
-const JUNK_EVENT = exports.JUNK_EVENT = "junk";
-const LINK_EVENT = exports.LINK_EVENT = "link";
-const PAGE_EVENT = exports.PAGE_EVENT = "page";
-const QUEUE_EVENT = exports.QUEUE_EVENT = "queue";
-const ROBOTS_EVENT = exports.ROBOTS_EVENT = "robots";
-const SITE_EVENT = exports.SITE_EVENT = "site";
-//# sourceMappingURL=events.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/events.js.map b/lib-cjs/internal/events.js.map
deleted file mode 100644
index 8645fa47..00000000
--- a/lib-cjs/internal/events.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"events.js","names":["COMPLETE_EVENT","exports","END_EVENT","ERROR_EVENT","HTML_EVENT","JUNK_EVENT","LINK_EVENT","PAGE_EVENT","QUEUE_EVENT","ROBOTS_EVENT","SITE_EVENT"],"sources":["../../lib/internal/events.js"],"sourcesContent":["export const COMPLETE_EVENT = \"complete\";\nexport const END_EVENT = \"end\";\nexport const ERROR_EVENT = \"error\";\nexport const HTML_EVENT = \"html\";\nexport const JUNK_EVENT = \"junk\";\nexport const LINK_EVENT = \"link\";\nexport const PAGE_EVENT = \"page\";\nexport const QUEUE_EVENT = \"queue\";\nexport const ROBOTS_EVENT = \"robots\";\nexport const SITE_EVENT = \"site\";\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,UAAU;AACjC,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,KAAK;AACvB,MAAMC,WAAW,GAAAF,OAAA,CAAAE,WAAA,GAAG,OAAO;AAC3B,MAAMC,UAAU,GAAAH,OAAA,CAAAG,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAG,MAAM;AACzB,MAAMC,UAAU,GAAAN,OAAA,CAAAM,UAAA,GAAG,MAAM;AACzB,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG,OAAO;AAC3B,MAAMC,YAAY,GAAAR,OAAA,CAAAQ,YAAA,GAAG,QAAQ;AAC7B,MAAMC,UAAU,GAAAT,OAAA,CAAAS,UAAA,GAAG,MAAM"}
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/checkLink.js b/lib-cjs/internal/file-protocol/checkLink.js
deleted file mode 100644
index f2b70f39..00000000
--- a/lib-cjs/internal/file-protocol/checkLink.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _Link = require("../Link");
-var _promises = require("fs/promises");
-/**
- * Check a link on the local file system.
- * @param {Link} link
- * @returns {Promise}
- */
-var _default = async link => {
-  try {
-    const {
-      isDirectory
-    } = await (0, _promises.stat)(link.get(_Link.REBASED_URL).pathname);
-    if (isDirectory()) {
-      link.exclude("BLC_DIRECTORY");
-    } else {
-      link.mend();
-    }
-  }
-  // @todo possible that a `Link` method could fail; then set BLC_UNKNOWN ?
-  catch ({
-    code
-  }) {
-    link.break(`ERRNO_${code}`);
-  }
-  return link;
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=checkLink.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/checkLink.js.map b/lib-cjs/internal/file-protocol/checkLink.js.map
deleted file mode 100644
index 5c6aa21f..00000000
--- a/lib-cjs/internal/file-protocol/checkLink.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"checkLink.js","names":["_Link","require","_promises","_default","link","isDirectory","statFile","get","REBASED_URL","pathname","exclude","mend","code","break","exports","default","module"],"sources":["../../../lib/internal/file-protocol/checkLink.js"],"sourcesContent":["import {REBASED_URL} from \"../Link\";\nimport {stat as statFile} from \"fs/promises\";\n\n\n\n/**\n * Check a link on the local file system.\n * @param {Link} link\n * @returns {Promise}\n */\nexport default async link =>\n{\n\ttry\n\t{\n\t\tconst {isDirectory} = await statFile(link.get(REBASED_URL).pathname);\n\n\t\tif (isDirectory())\n\t\t{\n\t\t\tlink.exclude(\"BLC_DIRECTORY\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlink.mend();\n\t\t}\n\t}\n\t// @todo possible that a `Link` method could fail; then set BLC_UNKNOWN ?\n\tcatch ({code})\n\t{\n\t\tlink.break(`ERRNO_${code}`);\n\t}\n\n\treturn link;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA;AACA;AACA;AACA;AACA;AAJA,IAAAE,QAAA,GAKe,MAAMC,IAAI,IACzB;EACC,IACA;IACC,MAAM;MAACC;IAAW,CAAC,GAAG,MAAM,IAAAC,cAAQ,EAACF,IAAI,CAACG,GAAG,CAACC,iBAAW,CAAC,CAACC,QAAQ,CAAC;IAEpE,IAAIJ,WAAW,CAAC,CAAC,EACjB;MACCD,IAAI,CAACM,OAAO,CAAC,eAAe,CAAC;IAC9B,CAAC,MAED;MACCN,IAAI,CAACO,IAAI,CAAC,CAAC;IACZ;EACD;EACA;EACA,OAAO;IAACC;EAAI,CAAC,EACb;IACCR,IAAI,CAACS,KAAK,CAAE,SAAQD,IAAK,EAAC,CAAC;EAC5B;EAEA,OAAOR,IAAI;AACZ,CAAC;AAAAU,OAAA,CAAAC,OAAA,GAAAZ,QAAA;AAAAa,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/errors.js b/lib-cjs/internal/file-protocol/errors.js
deleted file mode 100644
index c507dcad..00000000
--- a/lib-cjs/internal/file-protocol/errors.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.ExpectedHTMLExtensionError = void 0;
-class ExpectedHTMLExtensionError extends TypeError {
-  /**
-   * @param {string} extension
-   */
-  constructor(extension = "") {
-    if (extension !== "") {
-      extension = ` but got "${extension}"`;
-    }
-    super(`Expected a compatible HTML file extension$"{extension}`);
-  }
-}
-exports.ExpectedHTMLExtensionError = ExpectedHTMLExtensionError;
-//# sourceMappingURL=errors.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/errors.js.map b/lib-cjs/internal/file-protocol/errors.js.map
deleted file mode 100644
index 1fd2ecf1..00000000
--- a/lib-cjs/internal/file-protocol/errors.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"errors.js","names":["ExpectedHTMLExtensionError","TypeError","constructor","extension","exports"],"sources":["../../../lib/internal/file-protocol/errors.js"],"sourcesContent":["export class ExpectedHTMLExtensionError extends TypeError\n{\n\t/**\n\t * @param {string} extension\n\t */\n\tconstructor(extension = \"\")\n\t{\n\t\tif (extension !== \"\")\n\t\t{\n\t\t\textension = ` but got \"${extension}\"`;\n\t\t}\n\n\t\tsuper(`Expected a compatible HTML file extension$\"{extension}`);\n\t}\n}\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,SAASC,SAAS,CACzD;EACC;AACD;AACA;EACCC,WAAWA,CAACC,SAAS,GAAG,EAAE,EAC1B;IACC,IAAIA,SAAS,KAAK,EAAE,EACpB;MACCA,SAAS,GAAI,aAAYA,SAAU,GAAE;IACtC;IAEA,KAAK,CAAE,wDAAuD,CAAC;EAChE;AACD;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/index.js b/lib-cjs/internal/file-protocol/index.js
deleted file mode 100644
index 8f5f0229..00000000
--- a/lib-cjs/internal/file-protocol/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-Object.defineProperty(exports, "ExpectedHTMLExtensionError", {
-  enumerable: true,
-  get: function () {
-    return _errors.ExpectedHTMLExtensionError;
-  }
-});
-Object.defineProperty(exports, "checkLink", {
-  enumerable: true,
-  get: function () {
-    return _checkLink.default;
-  }
-});
-Object.defineProperty(exports, "isCompatibleScheme", {
-  enumerable: true,
-  get: function () {
-    return _isCompatibleScheme.default;
-  }
-});
-Object.defineProperty(exports, "streamHTML", {
-  enumerable: true,
-  get: function () {
-    return _streamHTML.default;
-  }
-});
-var _checkLink = _interopRequireDefault(require("./checkLink"));
-var _isCompatibleScheme = _interopRequireDefault(require("./isCompatibleScheme"));
-var _streamHTML = _interopRequireDefault(require("./streamHTML"));
-var _errors = require("./errors");
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/index.js.map b/lib-cjs/internal/file-protocol/index.js.map
deleted file mode 100644
index 82ad5ed7..00000000
--- a/lib-cjs/internal/file-protocol/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","names":["_checkLink","_interopRequireDefault","require","_isCompatibleScheme","_streamHTML","_errors","obj","__esModule","default"],"sources":["../../../lib/internal/file-protocol/index.js"],"sourcesContent":["// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as checkLink} from \"./checkLink\";\nexport {default as isCompatibleScheme} from \"./isCompatibleScheme\";\nexport {default as streamHTML} from \"./streamHTML\";\n\nexport {ExpectedHTMLExtensionError} from \"./errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAAoD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/isCompatibleScheme.js b/lib-cjs/internal/file-protocol/isCompatibleScheme.js
deleted file mode 100644
index b72c2fdd..00000000
--- a/lib-cjs/internal/file-protocol/isCompatibleScheme.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-/**
- * Determine whether a URL supports a file scheme/protocol.
- * @param {URL} url
- * @returns {boolean}
- */
-var _default = url => url.protocol === "file:";
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=isCompatibleScheme.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map b/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map
deleted file mode 100644
index 7a059c92..00000000
--- a/lib-cjs/internal/file-protocol/isCompatibleScheme.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"isCompatibleScheme.js","names":["_default","url","protocol","exports","default","module"],"sources":["../../../lib/internal/file-protocol/isCompatibleScheme.js"],"sourcesContent":["/**\n * Determine whether a URL supports a file scheme/protocol.\n * @param {URL} url\n * @returns {boolean}\n */\nexport default url => url.protocol === \"file:\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAAAA,QAAA,GAKeC,GAAG,IAAIA,GAAG,CAACC,QAAQ,KAAK,OAAO;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA;AAAAK,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/streamHTML.js b/lib-cjs/internal/file-protocol/streamHTML.js
deleted file mode 100644
index 8d528881..00000000
--- a/lib-cjs/internal/file-protocol/streamHTML.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _fs = require("fs");
-var _errors = require("./errors");
-var _path = require("path");
-var _errors2 = require("../errors");
-const FILE_EXTENSIONS = [".htm", ".html", ".xht", ".xhtml"];
-const ERROR_EVENT = "error";
-const OPEN_EVENT = "open";
-
-/**
- * Read a file URL for its HTML contents.
- * @param {URL} url
- * @throws {ExpectedHTMLExtensionError} if not HTML media type
- * @throws {HTMLRetrievalError} file not found, etc
- * @returns {Promise}
- * @todo return {response, stream} structure to be consistent with HTTP, and thereby support other protocols?
- */
-var _default = url => new Promise((resolve, reject) => {
-  const pathFileExtension = (0, _path.extname)(url.pathname);
-  if (!FILE_EXTENSIONS.some(ext => pathFileExtension === ext)) {
-    throw new _errors.ExpectedHTMLExtensionError(pathFileExtension);
-  } else {
-    const stream = (0, _fs.createReadStream)(url);
-    stream.on(ERROR_EVENT, ({
-      code
-    }) => reject(new _errors2.HTMLRetrievalError(code)));
-    stream.on(OPEN_EVENT, () => resolve(stream));
-  }
-});
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=streamHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/file-protocol/streamHTML.js.map b/lib-cjs/internal/file-protocol/streamHTML.js.map
deleted file mode 100644
index 0929cc68..00000000
--- a/lib-cjs/internal/file-protocol/streamHTML.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"streamHTML.js","names":["_fs","require","_errors","_path","_errors2","FILE_EXTENSIONS","ERROR_EVENT","OPEN_EVENT","_default","url","Promise","resolve","reject","pathFileExtension","extname","pathname","some","ext","ExpectedHTMLExtensionError","stream","createReadStream","on","code","HTMLRetrievalError","exports","default","module"],"sources":["../../../lib/internal/file-protocol/streamHTML.js"],"sourcesContent":["import {createReadStream} from \"fs\";\nimport {ExpectedHTMLExtensionError} from \"./errors\";\nimport {extname} from \"path\";\nimport {HTMLRetrievalError} from \"../errors\";\n\n\n\nconst FILE_EXTENSIONS = [\".htm\", \".html\", \".xht\", \".xhtml\"];\n\nconst ERROR_EVENT = \"error\";\nconst OPEN_EVENT = \"open\";\n\n\n\n/**\n * Read a file URL for its HTML contents.\n * @param {URL} url\n * @throws {ExpectedHTMLExtensionError} if not HTML media type\n * @throws {HTMLRetrievalError} file not found, etc\n * @returns {Promise}\n * @todo return {response, stream} structure to be consistent with HTTP, and thereby support other protocols?\n */\nexport default url => new Promise((resolve, reject) =>\n{\n\tconst pathFileExtension = extname(url.pathname);\n\n\tif (!FILE_EXTENSIONS.some(ext => pathFileExtension === ext))\n\t{\n\t\tthrow new ExpectedHTMLExtensionError(pathFileExtension);\n\t}\n\telse\n\t{\n\t\tconst stream = createReadStream(url);\n\n\t\tstream.on(ERROR_EVENT, ({code}) => reject(new HTMLRetrievalError(code)));\n\t\tstream.on(OPEN_EVENT, () => resolve(stream));\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAIA,MAAMI,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC;AAE3D,MAAMC,WAAW,GAAG,OAAO;AAC3B,MAAMC,UAAU,GAAG,MAAM;;AAIzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAQeC,GAAG,IAAI,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAClD;EACC,MAAMC,iBAAiB,GAAG,IAAAC,aAAO,EAACL,GAAG,CAACM,QAAQ,CAAC;EAE/C,IAAI,CAACV,eAAe,CAACW,IAAI,CAACC,GAAG,IAAIJ,iBAAiB,KAAKI,GAAG,CAAC,EAC3D;IACC,MAAM,IAAIC,kCAA0B,CAACL,iBAAiB,CAAC;EACxD,CAAC,MAED;IACC,MAAMM,MAAM,GAAG,IAAAC,oBAAgB,EAACX,GAAG,CAAC;IAEpCU,MAAM,CAACE,EAAE,CAACf,WAAW,EAAE,CAAC;MAACgB;IAAI,CAAC,KAAKV,MAAM,CAAC,IAAIW,2BAAkB,CAACD,IAAI,CAAC,CAAC,CAAC;IACxEH,MAAM,CAACE,EAAE,CAACd,UAAU,EAAE,MAAMI,OAAO,CAACQ,MAAM,CAAC,CAAC;EAC7C;AACD,CAAC,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAjB,QAAA;AAAAkB,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/checkLink.js b/lib-cjs/internal/http-protocol/checkLink.js
deleted file mode 100644
index 7f4c2348..00000000
--- a/lib-cjs/internal/http-protocol/checkLink.js
+++ /dev/null
@@ -1,84 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _lodash = require("lodash");
-var _Link = require("../Link");
-var _request = _interopRequireDefault(require("./request"));
-var _urlRelation = _interopRequireDefault(require("url-relation"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-/**
- * Copy data from a cached or uncached response into a Link.
- * @param {object|Error} response
- * @param {Link} link
- * @param {object} options
- */
-const copyResponseData = (response, link, {
-  cacheResponses
-}) => {
-  const {
-    code,
-    status,
-    url
-  } = response;
-  if (response instanceof Error) {
-    link.break(`ERRNO_${code}`);
-  } else {
-    if (status < 200 || status > 299) {
-      link.break(`HTTP_${status}`);
-    } else {
-      link.mend();
-    }
-
-    // @todo would a string check be sufficient?
-    if (!_urlRelation.default.match(url, link.get(_Link.REBASED_URL), {
-      targetComponent: _urlRelation.default.PATH
-    })) {
-      // @todo this needs a test
-      // @todo test if redirected to a different protocol
-      link.redirect(url);
-    }
-    if (cacheResponses) {
-      // Avoid potential mutations to cache
-      response = (0, _lodash.cloneDeep)(response);
-    }
-    link.set(_Link.HTTP_RESPONSE, response);
-  }
-};
-
-/**
- * Check a link's URL to see if it is broken or not.
- * @param {Link} link
- * @param {object} auth
- * @param {URLCache} cache
- * @param {object} options
- * @throws {TypeError} non-Link
- * @returns {Promise}
- */
-var _default = async (link, auth, cache, options) => {
-  const {
-    cacheResponses,
-    requestMethod
-  } = options;
-  if (cacheResponses) {
-    const result = cache.get(link.get(_Link.REBASED_URL));
-    if (result !== undefined) {
-      copyResponseData(await result, link, options);
-      link.set(_Link.HTTP_RESPONSE_WAS_CACHED, true);
-    }
-  }
-  if (link.get(_Link.HTTP_RESPONSE_WAS_CACHED) === null) {
-    const result = await (0, _request.default)(link.get(_Link.REBASED_URL), auth, requestMethod, cache, options).then(({
-      response
-    }) => response) // exclude any stream
-    .catch(error => error);
-    copyResponseData(result, link, options);
-    link.set(_Link.HTTP_RESPONSE_WAS_CACHED, false);
-  }
-  return link;
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=checkLink.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/checkLink.js.map b/lib-cjs/internal/http-protocol/checkLink.js.map
deleted file mode 100644
index 69bdb4bd..00000000
--- a/lib-cjs/internal/http-protocol/checkLink.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"checkLink.js","names":["_lodash","require","_Link","_request","_interopRequireDefault","_urlRelation","obj","__esModule","default","copyResponseData","response","link","cacheResponses","code","status","url","Error","break","mend","URLRelation","match","get","REBASED_URL","targetComponent","PATH","redirect","cloneDeep","set","HTTP_RESPONSE","_default","auth","cache","options","requestMethod","result","undefined","HTTP_RESPONSE_WAS_CACHED","request","then","catch","error","exports","module"],"sources":["../../../lib/internal/http-protocol/checkLink.js"],"sourcesContent":["import {cloneDeep} from \"lodash\";\nimport {HTTP_RESPONSE, HTTP_RESPONSE_WAS_CACHED, REBASED_URL} from \"../Link\";\nimport request from \"./request\";\nimport URLRelation from \"url-relation\";\n\n\n\n/**\n * Copy data from a cached or uncached response into a Link.\n * @param {object|Error} response\n * @param {Link} link\n * @param {object} options\n */\nconst copyResponseData = (response, link, {cacheResponses}) =>\n{\n\tconst {code, status, url} = response;\n\n\tif (response instanceof Error)\n\t{\n\t\tlink.break(`ERRNO_${code}`);\n\t}\n\telse\n\t{\n\t\tif (status<200 || status>299)\n\t\t{\n\t\t\tlink.break(`HTTP_${status}`);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlink.mend();\n\t\t}\n\n\t\t// @todo would a string check be sufficient?\n\t\tif (!URLRelation.match(url, link.get(REBASED_URL), { targetComponent:URLRelation.PATH }))\n\t\t{\n\t\t\t// @todo this needs a test\n\t\t\t// @todo test if redirected to a different protocol\n\t\t\tlink.redirect(url);\n\t\t}\n\n\t\tif (cacheResponses)\n\t\t{\n\t\t\t// Avoid potential mutations to cache\n\t\t\tresponse = cloneDeep(response);\n\t\t}\n\n\t\tlink.set(HTTP_RESPONSE, response);\n\t}\n};\n\n\n\n/**\n * Check a link's URL to see if it is broken or not.\n * @param {Link} link\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-Link\n * @returns {Promise}\n */\nexport default async (link, auth, cache, options) =>\n{\n\tconst {cacheResponses, requestMethod} = options;\n\n\tif (cacheResponses)\n\t{\n\t\tconst result = cache.get(link.get(REBASED_URL));\n\n\t\tif (result !== undefined)\n\t\t{\n\t\t\tcopyResponseData(await result, link, options);\n\n\t\t\tlink.set(HTTP_RESPONSE_WAS_CACHED, true);\n\t\t}\n\t}\n\n\tif (link.get(HTTP_RESPONSE_WAS_CACHED) === null)\n\t{\n\t\tconst result = await request(link.get(REBASED_URL), auth, requestMethod, cache, options)\n\t\t.then(({response}) => response)  // exclude any stream\n\t\t.catch(error => error);\n\n\t\tcopyResponseData(result, link, options);\n\n\t\tlink.set(HTTP_RESPONSE_WAS_CACHED, false);\n\t}\n\n\treturn link;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAuC,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIvC;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CAACC,QAAQ,EAAEC,IAAI,EAAE;EAACC;AAAc,CAAC,KAC1D;EACC,MAAM;IAACC,IAAI;IAAEC,MAAM;IAAEC;EAAG,CAAC,GAAGL,QAAQ;EAEpC,IAAIA,QAAQ,YAAYM,KAAK,EAC7B;IACCL,IAAI,CAACM,KAAK,CAAE,SAAQJ,IAAK,EAAC,CAAC;EAC5B,CAAC,MAED;IACC,IAAIC,MAAM,GAAC,GAAG,IAAIA,MAAM,GAAC,GAAG,EAC5B;MACCH,IAAI,CAACM,KAAK,CAAE,QAAOH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Q,CAAC,KAAKA,QAAQ,CAAC,CAAE;IAAA,CAChC6B,KAAK,CAACC,KAAK,IAAIA,KAAK,CAAC;IAEtB/B,gBAAgB,CAACyB,MAAM,EAAEvB,IAAI,EAAEqB,OAAO,CAAC;IAEvCrB,IAAI,CAACgB,GAAG,CAACS,8BAAwB,EAAE,KAAK,CAAC;EAC1C;EAEA,OAAOzB,IAAI;AACZ,CAAC;AAAA8B,OAAA,CAAAjC,OAAA,GAAAqB,QAAA;AAAAa,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/errors.js b/lib-cjs/internal/http-protocol/errors.js
deleted file mode 100644
index a8c9b2a6..00000000
--- a/lib-cjs/internal/http-protocol/errors.js
+++ /dev/null
@@ -1,21 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.ExpectedHTMLMediaTypeError = void 0;
-class ExpectedHTMLMediaTypeError extends TypeError {
-  /**
-   * @param {string} mediaType
-   * @param {number|string} statusCode
-   */
-  constructor(mediaType = "", statusCode) {
-    if (mediaType !== "") {
-      mediaType = ` but got "${mediaType}"`;
-    }
-    super(`Expected a compatible (X)HTML media type$"{mediaType}`);
-    this.code = statusCode;
-  }
-}
-exports.ExpectedHTMLMediaTypeError = ExpectedHTMLMediaTypeError;
-//# sourceMappingURL=errors.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/errors.js.map b/lib-cjs/internal/http-protocol/errors.js.map
deleted file mode 100644
index fe9c1676..00000000
--- a/lib-cjs/internal/http-protocol/errors.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"errors.js","names":["ExpectedHTMLMediaTypeError","TypeError","constructor","mediaType","statusCode","code","exports"],"sources":["../../../lib/internal/http-protocol/errors.js"],"sourcesContent":["export class ExpectedHTMLMediaTypeError extends TypeError\n{\n\t/**\n\t * @param {string} mediaType\n\t * @param {number|string} statusCode\n\t */\n\tconstructor(mediaType=\"\", statusCode)\n\t{\n\t\tif (mediaType !== \"\")\n\t\t{\n\t\t\tmediaType = ` but got \"${mediaType}\"`;\n\t\t}\n\n\t\tsuper(`Expected a compatible (X)HTML media type$\"{mediaType}`);\n\t\tthis.code = statusCode;\n\t}\n}\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,SAASC,SAAS,CACzD;EACC;AACD;AACA;AACA;EACCC,WAAWA,CAACC,SAAS,GAAC,EAAE,EAAEC,UAAU,EACpC;IACC,IAAID,SAAS,KAAK,EAAE,EACpB;MACCA,SAAS,GAAI,aAAYA,SAAU,GAAE;IACtC;IAEA,KAAK,CAAE,uDAAsD,CAAC;IAC9D,IAAI,CAACE,IAAI,GAAGD,UAAU;EACvB;AACD;AAACE,OAAA,CAAAN,0BAAA,GAAAA,0BAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/getRobotsTxt.js b/lib-cjs/internal/http-protocol/getRobotsTxt.js
deleted file mode 100644
index 75c4e33c..00000000
--- a/lib-cjs/internal/http-protocol/getRobotsTxt.js
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _reasons = require("../reasons");
-var _httpMethodsConstants = require("http-methods-constants");
-var _robotsTxtGuard = _interopRequireDefault(require("robots-txt-guard"));
-var _isurl = _interopRequireDefault(require("isurl"));
-var _robotsTxtParse = _interopRequireDefault(require("robots-txt-parse"));
-var _request = _interopRequireDefault(require("./request"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-/**
- * Download and parse a robots.txt file from a server's root path.
- * @param {URL} url
- * @param {object} auth
- * @param {URLCache} cache
- * @param {object} options
- * @throws {TypeError} non-URL
- * @returns {Promise}
- */
-var _default = async (url, auth, cache, options) => {
-  if (!(0, _isurl.default)(url)) {
-    throw new TypeError(_reasons.BLC_INVALID);
-  } else {
-    url = new URL(url);
-    url.hash = "";
-    url.pathname = "/robots.txt";
-    url.search = "";
-    const {
-      stream
-    } = await (0, _request.default)(url, auth, _httpMethodsConstants.GET, cache, options);
-
-    // @todo https://github.com/tc39/proposal-pipeline-operator
-    return (0, _robotsTxtGuard.default)(await (0, _robotsTxtParse.default)(stream));
-  }
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=getRobotsTxt.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/getRobotsTxt.js.map b/lib-cjs/internal/http-protocol/getRobotsTxt.js.map
deleted file mode 100644
index 93cb0eee..00000000
--- a/lib-cjs/internal/http-protocol/getRobotsTxt.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"getRobotsTxt.js","names":["_reasons","require","_httpMethodsConstants","_robotsTxtGuard","_interopRequireDefault","_isurl","_robotsTxtParse","_request","obj","__esModule","default","_default","url","auth","cache","options","isURL","TypeError","BLC_INVALID","URL","hash","pathname","search","stream","request","GET","guard","parse","exports","module"],"sources":["../../../lib/internal/http-protocol/getRobotsTxt.js"],"sourcesContent":["import {BLC_INVALID} from \"../reasons\";\nimport {GET} from \"http-methods-constants\";\nimport guard from \"robots-txt-guard\";\nimport isURL from \"isurl\";\nimport parse from \"robots-txt-parse\";\nimport request from \"./request\";\n\n\n\n/**\n * Download and parse a robots.txt file from a server's root path.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-URL\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\turl = new URL(url);\n\t\turl.hash = \"\";\n\t\turl.pathname = \"/robots.txt\";\n\t\turl.search = \"\";\n\n\t\tconst {stream} = await request(url, auth, GET, cache, options);\n\n\t\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t\treturn guard(await parse(stream));\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,eAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,QAAA,GAAAH,sBAAA,CAAAH,OAAA;AAAgC,SAAAG,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAAAG,QAAA,GASe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,IAAI,CAAC,IAAAC,cAAK,EAACJ,GAAG,CAAC,EACf;IACC,MAAM,IAAIK,SAAS,CAACC,oBAAW,CAAC;EACjC,CAAC,MAED;IACCN,GAAG,GAAG,IAAIO,GAAG,CAACP,GAAG,CAAC;IAClBA,GAAG,CAACQ,IAAI,GAAG,EAAE;IACbR,GAAG,CAACS,QAAQ,GAAG,aAAa;IAC5BT,GAAG,CAACU,MAAM,GAAG,EAAE;IAEf,MAAM;MAACC;IAAM,CAAC,GAAG,MAAM,IAAAC,gBAAO,EAACZ,GAAG,EAAEC,IAAI,EAAEY,yBAAG,EAAEX,KAAK,EAAEC,OAAO,CAAC;;IAE9D;IACA,OAAO,IAAAW,uBAAK,EAAC,MAAM,IAAAC,uBAAK,EAACJ,MAAM,CAAC,CAAC;EAClC;AACD,CAAC;AAAAK,OAAA,CAAAlB,OAAA,GAAAC,QAAA;AAAAkB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlB,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/index.js b/lib-cjs/internal/http-protocol/index.js
deleted file mode 100644
index 8ed2560e..00000000
--- a/lib-cjs/internal/http-protocol/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-Object.defineProperty(exports, "ExpectedHTMLMediaTypeError", {
-  enumerable: true,
-  get: function () {
-    return _errors.ExpectedHTMLMediaTypeError;
-  }
-});
-Object.defineProperty(exports, "checkLink", {
-  enumerable: true,
-  get: function () {
-    return _checkLink.default;
-  }
-});
-Object.defineProperty(exports, "getRobotsTxt", {
-  enumerable: true,
-  get: function () {
-    return _getRobotsTxt.default;
-  }
-});
-Object.defineProperty(exports, "isCompatibleScheme", {
-  enumerable: true,
-  get: function () {
-    return _isCompatibleScheme.default;
-  }
-});
-Object.defineProperty(exports, "streamHTML", {
-  enumerable: true,
-  get: function () {
-    return _streamHTML.default;
-  }
-});
-Object.defineProperty(exports, "transitiveAuth", {
-  enumerable: true,
-  get: function () {
-    return _transitiveAuth.default;
-  }
-});
-var _checkLink = _interopRequireDefault(require("./checkLink"));
-var _getRobotsTxt = _interopRequireDefault(require("./getRobotsTxt"));
-var _isCompatibleScheme = _interopRequireDefault(require("./isCompatibleScheme"));
-var _streamHTML = _interopRequireDefault(require("./streamHTML"));
-var _transitiveAuth = _interopRequireDefault(require("./transitiveAuth"));
-var _errors = require("./errors");
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/index.js.map b/lib-cjs/internal/http-protocol/index.js.map
deleted file mode 100644
index 1efa1fe5..00000000
--- a/lib-cjs/internal/http-protocol/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","names":["_checkLink","_interopRequireDefault","require","_getRobotsTxt","_isCompatibleScheme","_streamHTML","_transitiveAuth","_errors","obj","__esModule","default"],"sources":["../../../lib/internal/http-protocol/index.js"],"sourcesContent":["// @todo https://github.com/tc39/proposal-export-default-from\nexport {default as checkLink} from \"./checkLink\";\nexport {default as getRobotsTxt} from \"./getRobotsTxt\";\nexport {default as isCompatibleScheme} from \"./isCompatibleScheme\";\nexport {default as streamHTML} from \"./streamHTML\";\nexport {default as transitiveAuth} from \"./transitiveAuth\";\n\nexport {ExpectedHTMLMediaTypeError} from \"./errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAAoD,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/isCompatibleScheme.js b/lib-cjs/internal/http-protocol/isCompatibleScheme.js
deleted file mode 100644
index aa34a8c5..00000000
--- a/lib-cjs/internal/http-protocol/isCompatibleScheme.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-const SCHEMES = ["http:", "https:"];
-
-/**
- * Determine whether a URL supports an HTTP scheme/protocol.
- * @param {URL} url
- * @returns {boolean}
- */
-var _default = url => SCHEMES.some(scheme => url.protocol === scheme);
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=isCompatibleScheme.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map b/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map
deleted file mode 100644
index 192e22ad..00000000
--- a/lib-cjs/internal/http-protocol/isCompatibleScheme.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"isCompatibleScheme.js","names":["SCHEMES","_default","url","some","scheme","protocol","exports","default","module"],"sources":["../../../lib/internal/http-protocol/isCompatibleScheme.js"],"sourcesContent":["const SCHEMES = [\"http:\", \"https:\"];\n\n\n\n/**\n * Determine whether a URL supports an HTTP scheme/protocol.\n * @param {URL} url\n * @returns {boolean}\n */\nexport default url => SCHEMES.some(scheme => url.protocol === scheme);\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;;AAInC;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAKeC,GAAG,IAAIF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,GAAG,CAACG,QAAQ,KAAKD,MAAM,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAN,QAAA;AAAAO,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/request.js b/lib-cjs/internal/http-protocol/request.js
deleted file mode 100644
index ef47883c..00000000
--- a/lib-cjs/internal/http-protocol/request.js
+++ /dev/null
@@ -1,146 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _reasons = require("../reasons");
-var _httpMethodsConstants = require("http-methods-constants");
-var _isurl = _interopRequireDefault(require("isurl"));
-var _got = require("got");
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const ERROR_EVENT = "error";
-const REDIRECT_EVENT = "redirect";
-const RESPONSE_EVENT = "response";
-
-/**
- * Create an HTTP request.
- * @param {URL} url
- * @param {object} auth
- * @param {string} method
- * @param {object} options
- * @param {boolean} [isRetry]
- * @returns {Promise}
- */
-const createRequest = (url, auth, method, options, isRetry = false) => new Promise((resolve, reject) => {
-  const redirects = [];
-  (0, _got.stream)(url, {
-    auth: stringifyAuth(url, auth),
-    headers: {
-      "user-agent": options.userAgent,
-      ...options.customHeaders
-    },
-    method,
-    rejectUnauthorized: false,
-    // accept self-signed SSL certificates
-    retry: 0,
-    throwHttpErrors: false
-  }).on(ERROR_EVENT, reject)
-  // @todo test http 303
-  // @todo http 301/302 requests *can* have bodies, which could have links
-  .on(REDIRECT_EVENT, stream => redirects.push(simplifyResponse(stream))).on(RESPONSE_EVENT, stream => {
-    const response = simplifyResponse(stream, redirects);
-    if (!isRetry && method === _httpMethodsConstants.HEAD && options.retryHeadFail && options.retryHeadCodes.includes(response.status)) {
-      // Retry potentially broken server with GET
-      resolve(createRequest(url, auth, _httpMethodsConstants.GET, options, true));
-    } else if (method === _httpMethodsConstants.GET && response.status >= 200 && response.status <= 299) {
-      resolve({
-        response,
-        stream
-      });
-    } else {
-      resolve({
-        response
-      });
-    }
-  });
-});
-
-/**
- * Create a simple response object from that of the "http" module.
- * @param {object|Stream} response
- * @param {Array} [redirects]
- * @returns {object}
- * @todo add response time -- https://github.com/sindresorhus/got/issues/874
- */
-const simplifyResponse = ({
-  headers,
-  statusCode,
-  statusMessage,
-  url
-}, redirects) => ({
-  headers,
-  status: statusCode,
-  statusText: statusMessage,
-  url: new URL(url),
-  ...(redirects && {
-    redirects
-  }) // only return/destructure object if value is truthy
-});
-
-/**
- * Convert an HTTP authentication URL or object into a string.
- * @param {URL} url
- * @param {object} auth
- * @returns {string}
- */
-const stringifyAuth = (url, auth) => {
-  if (url.password !== "" || url.username !== "") {
-    return `${url.username}:${url.password}`;
-  } else if (auth.password !== "" || auth.username !== "") {
-    return `${auth.username}:${auth.password}`;
-  }
-};
-
-/**
- * Create an HTTP request and optionally cache the response.
- * @param {URL} url
- * @param {object} auth
- * @param {string} method
- * @param {URLCache} cache
- * @param {object} options
- * @throws {TypeError} non-URL
- * @returns {Promise}
- * @todo use `Promise.try()` instead of `async`
- */
-var _default = async (url, auth, method, cache, options) => {
-  if (!(0, _isurl.default)(url)) {
-    throw new TypeError(_reasons.BLC_INVALID);
-  } else {
-    const promise = createRequest(url, auth, method, options);
-    if (options.cacheResponses) {
-      const cachedPromise = promise.then(({
-        response
-      }) => {
-        // Replace cached promise
-        // @todo store in a "response" key, so that we can also store a list of all element IDs in the document
-        cache.set(url, response);
-
-        // Any final redirect
-        // @todo store in a "response" key, so that we can also store a list of all element IDs in the document
-        cache.set(response.url, response);
-
-        // Any intermediary redirects
-        response.redirects.forEach((redirect, i) => {
-          const subsequentRedirects = response.redirects.slice(i + 1);
-
-          // @todo store in a "response" key, so that we can also store a list of all element IDs in the document
-          cache.set(redirect.url, {
-            ...response,
-            redirects: subsequentRedirects
-          });
-        });
-        return response;
-      }).catch(error => error); // pass-through
-
-      // Make future response available to other requests before completion
-      // Will always overwrite previous value
-      // @todo store in a "response" key, so that we can also store a list of all element IDs in the document
-      cache.set(url, cachedPromise);
-    }
-    return promise;
-  }
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=request.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/request.js.map b/lib-cjs/internal/http-protocol/request.js.map
deleted file mode 100644
index 28d0c51b..00000000
--- a/lib-cjs/internal/http-protocol/request.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"request.js","names":["_reasons","require","_httpMethodsConstants","_isurl","_interopRequireDefault","_got","obj","__esModule","default","ERROR_EVENT","REDIRECT_EVENT","RESPONSE_EVENT","createRequest","url","auth","method","options","isRetry","Promise","resolve","reject","redirects","streamHTTP","stringifyAuth","headers","userAgent","customHeaders","rejectUnauthorized","retry","throwHttpErrors","on","stream","push","simplifyResponse","response","HEAD","retryHeadFail","retryHeadCodes","includes","status","GET","statusCode","statusMessage","statusText","URL","password","username","_default","cache","isURL","TypeError","BLC_INVALID","promise","cacheResponses","cachedPromise","then","set","forEach","redirect","i","subsequentRedirects","slice","catch","error","exports","module"],"sources":["../../../lib/internal/http-protocol/request.js"],"sourcesContent":["import {BLC_INVALID} from \"../reasons\";\nimport {GET, HEAD} from \"http-methods-constants\";\nimport isURL from \"isurl\";\nimport {stream as streamHTTP} from \"got\";\n\n\n\nconst ERROR_EVENT = \"error\";\nconst REDIRECT_EVENT = \"redirect\";\nconst RESPONSE_EVENT = \"response\";\n\n\n\n/**\n * Create an HTTP request.\n * @param {URL} url\n * @param {object} auth\n * @param {string} method\n * @param {object} options\n * @param {boolean} [isRetry]\n * @returns {Promise}\n */\nconst createRequest = (url, auth, method, options, isRetry=false) => new Promise((resolve, reject) =>\n{\n\tconst redirects = [];\n\n\tstreamHTTP(url,\n\t{\n\t\tauth: stringifyAuth(url, auth),\n\t\theaders: { \"user-agent\":options.userAgent, ...options.customHeaders },\n\t\tmethod,\n\t\trejectUnauthorized: false,  // accept self-signed SSL certificates\n\t\tretry: 0,\n\t\tthrowHttpErrors: false\n\t})\n\t.on(ERROR_EVENT, reject)\n\t// @todo test http 303\n\t// @todo http 301/302 requests *can* have bodies, which could have links\n\t.on(REDIRECT_EVENT, stream => redirects.push( simplifyResponse(stream) ))\n\t.on(RESPONSE_EVENT, stream =>\n\t{\n\t\tconst response = simplifyResponse(stream, redirects);\n\n\t\tif (!isRetry && method===HEAD && options.retryHeadFail && options.retryHeadCodes.includes(response.status))\n\t\t{\n\t\t\t// Retry potentially broken server with GET\n\t\t\tresolve( createRequest(url, auth, GET, options, true) );\n\t\t}\n\t\telse if (method===GET && response.status>=200 && response.status<=299)\n\t\t{\n\t\t\tresolve({ response, stream });\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresolve({ response });\n\t\t}\n\t});\n});\n\n\n\n/**\n * Create a simple response object from that of the \"http\" module.\n * @param {object|Stream} response\n * @param {Array} [redirects]\n * @returns {object}\n * @todo add response time -- https://github.com/sindresorhus/got/issues/874\n */\nconst simplifyResponse = ({headers, statusCode, statusMessage, url}, redirects) =>\n({\n\theaders,\n\tstatus: statusCode,\n\tstatusText: statusMessage,\n\turl: new URL(url),\n\t...(redirects && {redirects}) // only return/destructure object if value is truthy\n});\n\n\n\n/**\n * Convert an HTTP authentication URL or object into a string.\n * @param {URL} url\n * @param {object} auth\n * @returns {string}\n */\nconst stringifyAuth = (url, auth) =>\n{\n\tif (url.password!==\"\" || url.username!==\"\")\n\t{\n\t\treturn `${url.username}:${url.password}`;\n\t}\n\telse if (auth.password!==\"\" || auth.username!==\"\")\n\t{\n\t\treturn `${auth.username}:${auth.password}`;\n\t}\n};\n\n\n\n/**\n * Create an HTTP request and optionally cache the response.\n * @param {URL} url\n * @param {object} auth\n * @param {string} method\n * @param {URLCache} cache\n * @param {object} options\n * @throws {TypeError} non-URL\n * @returns {Promise}\n * @todo use `Promise.try()` instead of `async`\n */\nexport default async (url, auth, method, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\tconst promise = createRequest(url, auth, method, options);\n\n\t\tif (options.cacheResponses)\n\t\t{\n\t\t\tconst cachedPromise = promise\n\t\t\t.then(({response}) =>\n\t\t\t{\n\t\t\t\t// Replace cached promise\n\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\tcache.set(url, response);\n\n\t\t\t\t// Any final redirect\n\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\tcache.set(response.url, response);\n\n\t\t\t\t// Any intermediary redirects\n\t\t\t\tresponse.redirects.forEach((redirect, i) =>\n\t\t\t\t{\n\t\t\t\t\tconst subsequentRedirects = response.redirects.slice(i + 1);\n\n\t\t\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\t\t\tcache.set(redirect.url, {...response, redirects:subsequentRedirects});\n\t\t\t\t});\n\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch(error => error);  // pass-through\n\n\t\t\t// Make future response available to other requests before completion\n\t\t\t// Will always overwrite previous value\n\t\t\t// @todo store in a \"response\" key, so that we can also store a list of all element IDs in the document\n\t\t\tcache.set(url, cachedPromise);\n\t\t}\n\n\t\treturn promise;\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE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A,GAAAA,OAAA,CAAAxD,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/streamHTML.js b/lib-cjs/internal/http-protocol/streamHTML.js
deleted file mode 100644
index 39418630..00000000
--- a/lib-cjs/internal/http-protocol/streamHTML.js
+++ /dev/null
@@ -1,50 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _errors = require("./errors");
-var _httpMethodsConstants = require("http-methods-constants");
-var _errors2 = require("../errors");
-var _request = _interopRequireDefault(require("./request"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const CONTENT_TYPE = "content-type";
-const HTML_MIMETYPE = "text/html";
-const XHTML_MIMETYPE = "application/xhtml+xml";
-
-/**
- * Request a URL for its HTML contents.
- * @param {URL} url
- * @param {object} auth
- * @param {URLCache} cache
- * @param {object} options
- * @throws {ExpectedHTMLMediaTypeError} if not HTML media type
- * @throws {HTMLRetrievalError} 404, etc
- * @throws {Error} if failed connection
- * @returns {Promise}
- */
-var _default = async (url, auth, cache, options) => {
-  const result = await (0, _request.default)(url, auth, _httpMethodsConstants.GET, cache, options);
-  const {
-    response: {
-      headers,
-      status
-    }
-  } = result;
-  if (status < 200 || status > 299) {
-    throw new _errors2.HTMLRetrievalError(status);
-  } else {
-    const type = headers[CONTENT_TYPE];
-
-    // Content-type is not mandatory in HTTP spec
-    // Could have trailing charset
-    if (!(type !== null && type !== void 0 && type.startsWith(HTML_MIMETYPE)) && !(type !== null && type !== void 0 && type.startsWith(XHTML_MIMETYPE))) {
-      throw new _errors.ExpectedHTMLMediaTypeError(type, status);
-    }
-  }
-  return result;
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=streamHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/streamHTML.js.map b/lib-cjs/internal/http-protocol/streamHTML.js.map
deleted file mode 100644
index 5174c8b3..00000000
--- a/lib-cjs/internal/http-protocol/streamHTML.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"streamHTML.js","names":["_errors","require","_httpMethodsConstants","_errors2","_request","_interopRequireDefault","obj","__esModule","default","CONTENT_TYPE","HTML_MIMETYPE","XHTML_MIMETYPE","_default","url","auth","cache","options","result","request","GET","response","headers","status","HTMLRetrievalError","type","startsWith","ExpectedHTMLMediaTypeError","exports","module"],"sources":["../../../lib/internal/http-protocol/streamHTML.js"],"sourcesContent":["import {ExpectedHTMLMediaTypeError} from \"./errors\";\nimport {GET} from \"http-methods-constants\";\nimport {HTMLRetrievalError} from \"../errors\";\nimport request from \"./request\";\n\n\n\nconst CONTENT_TYPE = \"content-type\";\nconst HTML_MIMETYPE = \"text/html\";\nconst XHTML_MIMETYPE = \"application/xhtml+xml\";\n\n\n\n/**\n * Request a URL for its HTML contents.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {ExpectedHTMLMediaTypeError} if not HTML media type\n * @throws {HTMLRetrievalError} 404, etc\n * @throws {Error} if failed connection\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tconst result = await request(url, auth, GET, cache, options);\n\tconst {response: {headers, status}} = result;\n\n\tif (status<200 || status>299)\n\t{\n\t\tthrow new HTMLRetrievalError(status);\n\t}\n\telse\n\t{\n\t\tconst type = headers[CONTENT_TYPE];\n\n\t\t// Content-type is not mandatory in HTTP spec\n\t\t// Could have trailing charset\n\t\tif (!type?.startsWith(HTML_MIMETYPE) && !type?.startsWith(XHTML_MIMETYPE))\n\t\t{\n\t\t\tthrow new ExpectedHTMLMediaTypeError(type, status);\n\t\t}\n\t}\n\n\treturn result;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAgC,SAAAI,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhC,MAAMG,YAAY,GAAG,cAAc;AACnC,MAAMC,aAAa,GAAG,WAAW;AACjC,MAAMC,cAAc,GAAG,uBAAuB;;AAI9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAC,QAAA,GAWe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,MAAMC,MAAM,GAAG,MAAM,IAAAC,gBAAO,EAACL,GAAG,EAAEC,IAAI,EAAEK,yBAAG,EAAEJ,KAAK,EAAEC,OAAO,CAAC;EAC5D,MAAM;IAACI,QAAQ,EAAE;MAACC,OAAO;MAAEC;IAAM;EAAC,CAAC,GAAGL,MAAM;EAE5C,IAAIK,MAAM,GAAC,GAAG,IAAIA,MAAM,GAAC,GAAG,EAC5B;IACC,MAAM,IAAIC,2BAAkB,CAACD,MAAM,CAAC;EACrC,CAAC,MAED;IACC,MAAME,IAAI,GAAGH,OAAO,CAACZ,YAAY,CAAC;;IAElC;IACA;IACA,IAAI,EAACe,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEC,UAAU,CAACf,aAAa,CAAC,KAAI,EAACc,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEC,UAAU,CAACd,cAAc,CAAC,GACzE;MACC,MAAM,IAAIe,kCAA0B,CAACF,IAAI,EAAEF,MAAM,CAAC;IACnD;EACD;EAEA,OAAOL,MAAM;AACd,CAAC;AAAAU,OAAA,CAAAnB,OAAA,GAAAI,QAAA;AAAAgB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAnB,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/transitiveAuth.js b/lib-cjs/internal/http-protocol/transitiveAuth.js
deleted file mode 100644
index 670fefa4..00000000
--- a/lib-cjs/internal/http-protocol/transitiveAuth.js
+++ /dev/null
@@ -1,42 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _isurl = _interopRequireDefault(require("isurl"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const DEFAULT_AUTH = Object.freeze({
-  password: "",
-  username: ""
-});
-
-/**
- * Possibly override `auth` with that from `url`.
- * @param {URL} url
- * @param {object} [auth]
- * @returns {object}
- */
-var _default = (url, auth = DEFAULT_AUTH) => {
-  if (!(0, _isurl.default)(url)) {
-    throw new TypeError("Invalid URL");
-  } else if (url.username !== "" || url.password !== "") {
-    // Clone to avoid mutation
-    url = new URL(url);
-    auth = {
-      password: url.password,
-      username: url.username
-    };
-
-    // @todo is this the kind of result we want, with auth stored in `http` ?
-    url.password = "";
-    url.username = "";
-  }
-  return {
-    auth,
-    url
-  };
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=transitiveAuth.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/http-protocol/transitiveAuth.js.map b/lib-cjs/internal/http-protocol/transitiveAuth.js.map
deleted file mode 100644
index f39f5bfb..00000000
--- a/lib-cjs/internal/http-protocol/transitiveAuth.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"transitiveAuth.js","names":["_isurl","_interopRequireDefault","require","obj","__esModule","default","DEFAULT_AUTH","Object","freeze","password","username","_default","url","auth","isURL","TypeError","URL","exports","module"],"sources":["../../../lib/internal/http-protocol/transitiveAuth.js"],"sourcesContent":["import isURL from \"isurl\";\n\n\n\nconst DEFAULT_AUTH = Object.freeze({ password:\"\", username:\"\" });\n\n\n\n/**\n * Possibly override `auth` with that from `url`.\n * @param {URL} url\n * @param {object} [auth]\n * @returns {object}\n */\nexport default (url, auth=DEFAULT_AUTH) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(\"Invalid URL\");\n\t}\n\telse if (url.username!==\"\" || url.password!==\"\")\n\t{\n\t\t// Clone to avoid mutation\n\t\turl = new URL(url);\n\n\t\tauth =\n\t\t{\n\t\t\tpassword: url.password,\n\t\t\tusername: url.username\n\t\t};\n\n\t\t// @todo is this the kind of result we want, with auth stored in `http` ?\n\t\turl.password = \"\";\n\t\turl.username = \"\";\n\t}\n\n\treturn { auth, url };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1B,MAAMG,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC;EAAEC,QAAQ,EAAC,EAAE;EAAEC,QAAQ,EAAC;AAAG,CAAC,CAAC;;AAIhE;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAMeA,CAACC,GAAG,EAAEC,IAAI,GAACP,YAAY,KACtC;EACC,IAAI,CAAC,IAAAQ,cAAK,EAACF,GAAG,CAAC,EACf;IACC,MAAM,IAAIG,SAAS,CAAC,aAAa,CAAC;EACnC,CAAC,MACI,IAAIH,GAAG,CAACF,QAAQ,KAAG,EAAE,IAAIE,GAAG,CAACH,QAAQ,KAAG,EAAE,EAC/C;IACC;IACAG,GAAG,GAAG,IAAII,GAAG,CAACJ,GAAG,CAAC;IAElBC,IAAI,GACJ;MACCJ,QAAQ,EAAEG,GAAG,CAACH,QAAQ;MACtBC,QAAQ,EAAEE,GAAG,CAACF;IACf,CAAC;;IAED;IACAE,GAAG,CAACH,QAAQ,GAAG,EAAE;IACjBG,GAAG,CAACF,QAAQ,GAAG,EAAE;EAClB;EAEA,OAAO;IAAEG,IAAI;IAAED;EAAI,CAAC;AACrB,CAAC;AAAAK,OAAA,CAAAZ,OAAA,GAAAM,QAAA;AAAAO,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAZ,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/matchURL.js b/lib-cjs/internal/matchURL.js
deleted file mode 100644
index 5a2fd542..00000000
--- a/lib-cjs/internal/matchURL.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _matcher = require("matcher");
-/**
- * Determine if a URL contains at least one—possibly glob'bed—keyword.
- * @param {string} url
- * @param {Array} keywords
- * @returns {boolean}
- */
-var _default = (url, keywords) => keywords.some(keyword => {
-  // Check for literal keyword
-  if (url.includes(keyword)) {
-    return true;
-  } else {
-    // Check for glob
-    return (0, _matcher.isMatch)(url, keyword);
-  }
-});
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=matchURL.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/matchURL.js.map b/lib-cjs/internal/matchURL.js.map
deleted file mode 100644
index 9c7329c9..00000000
--- a/lib-cjs/internal/matchURL.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"matchURL.js","names":["_matcher","require","_default","url","keywords","some","keyword","includes","isMatch","exports","default","module"],"sources":["../../lib/internal/matchURL.js"],"sourcesContent":["import {isMatch} from \"matcher\";\n\n\n\n/**\n * Determine if a URL contains at least one—possibly glob'bed—keyword.\n * @param {string} url\n * @param {Array} keywords\n * @returns {boolean}\n */\nexport default (url, keywords) => keywords.some(keyword =>\n{\n\t// Check for literal keyword\n\tif (url.includes(keyword))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\t// Check for glob\n\t\treturn isMatch(url, keyword);\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAMeA,CAACC,GAAG,EAAEC,QAAQ,KAAKA,QAAQ,CAACC,IAAI,CAACC,OAAO,IACvD;EACC;EACA,IAAIH,GAAG,CAACI,QAAQ,CAACD,OAAO,CAAC,EACzB;IACC,OAAO,IAAI;EACZ,CAAC,MAED;IACC;IACA,OAAO,IAAAE,gBAAO,EAACL,GAAG,EAAEG,OAAO,CAAC;EAC7B;AACD,CAAC,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAR,QAAA;AAAAS,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/parseHTML.js b/lib-cjs/internal/parseHTML.js
deleted file mode 100644
index 76851422..00000000
--- a/lib-cjs/internal/parseHTML.js
+++ /dev/null
@@ -1,59 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _default2 = _interopRequireDefault(require("parse5/lib/tree-adapters/default"));
-var _isStream = _interopRequireDefault(require("is-stream"));
-var _isString = _interopRequireDefault(require("is-string"));
-var _parse = require("parse5");
-var _parse5ParserStream = _interopRequireDefault(require("parse5-parser-stream"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const ERROR_EVENT = "error";
-const FINISH_EVENT = "finish";
-const OPTIONS = {
-  sourceCodeLocationInfo: true,
-  treeAdapter: {
-    ..._default2.default,
-    createElement: (...args) => {
-      const result = _default2.default.createElement(...args);
-      result.attrMap = simplifyAttrs(result.attrs);
-      return result;
-    }
-  }
-};
-
-/**
- * Convert a list of parse5 attributes into key-value pairs.
- * Note: spec-compliant HTML cannot have multiple attrs of the same name.
- * @param {Array} attrs
- * @returns {object}
- *
- * @todo https://github.com/tc39/proposal-pipeline-operator
- */
-const simplifyAttrs = attrs => Object.fromEntries(attrs.map(({
-  name,
-  value
-}) => [name, value]));
-
-/**
- * Parse an HTML stream/string and return a tree.
- * @param {Stream|string} input
- * @throws {TypeError} non-Stream or non-string
- * @returns {Promise}
- */
-var _default = input => new Promise((resolve, reject) => {
-  if ((0, _isStream.default)(input)) {
-    const parser = new _parse5ParserStream.default(OPTIONS).once(ERROR_EVENT, reject) // @todo test this
-    .once(FINISH_EVENT, () => resolve(parser.document));
-    input.setEncoding("utf8").pipe(parser);
-  } else if ((0, _isString.default)(input)) {
-    resolve((0, _parse.parse)(input, OPTIONS));
-  } else {
-    reject(new TypeError("Invalid input"));
-  }
-});
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=parseHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/parseHTML.js.map b/lib-cjs/internal/parseHTML.js.map
deleted file mode 100644
index 6c70e0ba..00000000
--- a/lib-cjs/internal/parseHTML.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"parseHTML.js","names":["_default2","_interopRequireDefault","require","_isStream","_isString","_parse","_parse5ParserStream","obj","__esModule","default","ERROR_EVENT","FINISH_EVENT","OPTIONS","sourceCodeLocationInfo","treeAdapter","defaultTreeAdapter","createElement","args","result","attrMap","simplifyAttrs","attrs","Object","fromEntries","map","name","value","_default","input","Promise","resolve","reject","isStream","parser","ParserStream","once","document","setEncoding","pipe","isString","parse","TypeError","exports","module"],"sources":["../../lib/internal/parseHTML.js"],"sourcesContent":["import defaultTreeAdapter from \"parse5/lib/tree-adapters/default\";\nimport isStream from \"is-stream\";\nimport isString from \"is-string\";\nimport {parse} from \"parse5\";\nimport ParserStream from \"parse5-parser-stream\";\n\n\n\nconst ERROR_EVENT = \"error\";\nconst FINISH_EVENT = \"finish\";\n\n\n\nconst OPTIONS =\n{\n\tsourceCodeLocationInfo: true,\n\ttreeAdapter:\n\t{\n\t\t...defaultTreeAdapter,\n\n\t\tcreateElement: (...args) =>\n\t\t{\n\t\t\tconst result = defaultTreeAdapter.createElement(...args);\n\t\t\tresult.attrMap = simplifyAttrs(result.attrs);\n\t\t\treturn result;\n\t\t}\n\t}\n};\n\n\n\n/**\n * Convert a list of parse5 attributes into key-value pairs.\n * Note: spec-compliant HTML cannot have multiple attrs of the same name.\n * @param {Array} attrs\n * @returns {object}\n *\n * @todo https://github.com/tc39/proposal-pipeline-operator\n */\nconst simplifyAttrs = attrs => Object.fromEntries(attrs.map(({name, value}) => [name, value]));\n\n\n\n/**\n * Parse an HTML stream/string and return a tree.\n * @param {Stream|string} input\n * @throws {TypeError} non-Stream or non-string\n * @returns {Promise}\n */\nexport default input => new Promise((resolve, reject) =>\n{\n\tif (isStream(input))\n\t{\n\t\tconst parser = new ParserStream(OPTIONS)\n\t\t.once(ERROR_EVENT, reject)  // @todo test this\n\t\t.once(FINISH_EVENT, () => resolve(parser.document));\n\n\t\tinput\n\t\t\t.setEncoding(\"utf8\")\n\t\t\t.pipe(parser);\n\t}\n\telse if (isString(input))\n\t{\n\t\tresolve( parse(input, OPTIONS) );\n\t}\n\telse\n\t{\n\t\treject( new TypeError(\"Invalid input\") );\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhD,MAAMG,WAAW,GAAG,OAAO;AAC3B,MAAMC,YAAY,GAAG,QAAQ;AAI7B,MAAMC,OAAO,GACb;EACCC,sBAAsB,EAAE,IAAI;EAC5BC,WAAW,EACX;IACC,GAAGC,iBAAkB;IAErBC,aAAa,EAAEA,CAAC,GAAGC,IAAI,KACvB;MACC,MAAMC,MAAM,GAAGH,iBAAkB,CAACC,aAAa,CAAC,GAAGC,IAAI,CAAC;MACxDC,MAAM,CAACC,OAAO,GAAGC,aAAa,CAACF,MAAM,CAACG,KAAK,CAAC;MAC5C,OAAOH,MAAM;IACd;EACD;AACD,CAAC;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGC,KAAK,IAAIC,MAAM,CAACC,WAAW,CAACF,KAAK,CAACG,GAAG,CAAC,CAAC;EAACC,IAAI;EAAEC;AAAK,CAAC,KAAK,CAACD,IAAI,EAAEC,KAAK,CAAC,CAAC,CAAC;;AAI9F;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAMeC,KAAK,IAAI,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KACpD;EACC,IAAI,IAAAC,iBAAQ,EAACJ,KAAK,CAAC,EACnB;IACC,MAAMK,MAAM,GAAG,IAAIC,2BAAY,CAACtB,OAAO,CAAC,CACvCuB,IAAI,CAACzB,WAAW,EAAEqB,MAAM,CAAC,CAAE;IAAA,CAC3BI,IAAI,CAACxB,YAAY,EAAE,MAAMmB,OAAO,CAACG,MAAM,CAACG,QAAQ,CAAC,CAAC;IAEnDR,KAAK,CACHS,WAAW,CAAC,MAAM,CAAC,CACnBC,IAAI,CAACL,MAAM,CAAC;EACf,CAAC,MACI,IAAI,IAAAM,iBAAQ,EAACX,KAAK,CAAC,EACxB;IACCE,OAAO,CAAE,IAAAU,YAAK,EAACZ,KAAK,EAAEhB,OAAO,CAAE,CAAC;EACjC,CAAC,MAED;IACCmB,MAAM,CAAE,IAAIU,SAAS,CAAC,eAAe,CAAE,CAAC;EACzC;AACD,CAAC,CAAC;AAAAC,OAAA,CAAAjC,OAAA,GAAAkB,QAAA;AAAAgB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/parseOptions.js b/lib-cjs/internal/parseOptions.js
deleted file mode 100644
index 7946e2b1..00000000
--- a/lib-cjs/internal/parseOptions.js
+++ /dev/null
@@ -1,33 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _defaultOptions = _interopRequireDefault(require("./defaultOptions"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const HAS_BEEN_PARSED_VALUE = Symbol();
-
-/**
- * Combine consumer options with defaults, then normalize/optimize.
- * @param {object} [options]
- * @returns {object}
- */
-var _default = (options = {}) => {
-  if (options.__parsed !== HAS_BEEN_PARSED_VALUE) {
-    options = {
-      ..._defaultOptions.default,
-      ...options
-    };
-
-    // https://npmjs.com/request-methods-constants are upper case
-    options.requestMethod = options.requestMethod.toUpperCase();
-
-    // Undocumented -- avoids reparsing options passed through from class to class
-    options.__parsed = HAS_BEEN_PARSED_VALUE;
-  }
-  return options;
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=parseOptions.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/parseOptions.js.map b/lib-cjs/internal/parseOptions.js.map
deleted file mode 100644
index da149c7e..00000000
--- a/lib-cjs/internal/parseOptions.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"parseOptions.js","names":["_defaultOptions","_interopRequireDefault","require","obj","__esModule","default","HAS_BEEN_PARSED_VALUE","Symbol","_default","options","__parsed","DEFAULT_OPTIONS","requestMethod","toUpperCase","exports","module"],"sources":["../../lib/internal/parseOptions.js"],"sourcesContent":["import DEFAULT_OPTIONS from \"./defaultOptions\";\n\n\n\nconst HAS_BEEN_PARSED_VALUE = Symbol();\n\n\n\n/**\n * Combine consumer options with defaults, then normalize/optimize.\n * @param {object} [options]\n * @returns {object}\n */\nexport default (options = {}) =>\n{\n\tif (options.__parsed !== HAS_BEEN_PARSED_VALUE)\n\t{\n\t\toptions = { ...DEFAULT_OPTIONS, ...options };\n\n\t\t// https://npmjs.com/request-methods-constants are upper case\n\t\toptions.requestMethod = options.requestMethod.toUpperCase();\n\n\t\t// Undocumented -- avoids reparsing options passed through from class to class\n\t\toptions.__parsed = HAS_BEEN_PARSED_VALUE;\n\t}\n\n\treturn options;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI/C,MAAMG,qBAAqB,GAAGC,MAAM,CAAC,CAAC;;AAItC;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAKeA,CAACC,OAAO,GAAG,CAAC,CAAC,KAC5B;EACC,IAAIA,OAAO,CAACC,QAAQ,KAAKJ,qBAAqB,EAC9C;IACCG,OAAO,GAAG;MAAE,GAAGE,uBAAe;MAAE,GAAGF;IAAQ,CAAC;;IAE5C;IACAA,OAAO,CAACG,aAAa,GAAGH,OAAO,CAACG,aAAa,CAACC,WAAW,CAAC,CAAC;;IAE3D;IACAJ,OAAO,CAACC,QAAQ,GAAGJ,qBAAqB;EACzC;EAEA,OAAOG,OAAO;AACf,CAAC;AAAAK,OAAA,CAAAT,OAAA,GAAAG,QAAA;AAAAO,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAT,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/reasons.js b/lib-cjs/internal/reasons.js
deleted file mode 100644
index 4c36ad96..00000000
--- a/lib-cjs/internal/reasons.js
+++ /dev/null
@@ -1,32 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _errno = require("errno");
-var _http = require("http");
-var _default = exports.default = Object.freeze({
-  BLC_CUSTOM: "Custom exclusion",
-  BLC_DIRECTORY: "File system directory exclusion",
-  BLC_EXTERNAL: "External URL exclusion",
-  BLC_HTML: "HTML exclusion",
-  BLC_INTERNAL: "Internal URL exclusion",
-  BLC_INVALID: "Invalid URL",
-  BLC_KEYWORD: "Keyword exclusion",
-  BLC_ROBOTS: "Robots exclusion",
-  BLC_SAMEPAGE: "Same-Page URL exclusion",
-  BLC_UNKNOWN: "Unknown error",
-  BLC_UNSUPPORTED: "Unsupported URL",
-  // https://github.com/rvagg/node-errno/issues/14
-  ERRNO_ENOTFOUND: "no matching dns record (ENOTFOUND)",
-  // @todo https://github.com/tc39/proposal-pipeline-operator
-  ...Object.fromEntries(_errno.all.map(({
-    code,
-    description
-  }) => [`ERRNO_${code}`, `${description} (${code})`])),
-  // @todo https://github.com/tc39/proposal-pipeline-operator
-  ...Object.fromEntries(Object.entries(_http.STATUS_CODES).map(([key, value]) => [`HTTP_${key}`, `${value} (${key})`]))
-});
-module.exports = exports.default;
-//# sourceMappingURL=reasons.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/reasons.js.map b/lib-cjs/internal/reasons.js.map
deleted file mode 100644
index bc5ac7f3..00000000
--- a/lib-cjs/internal/reasons.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"reasons.js","names":["_errno","require","_http","_default","exports","default","Object","freeze","BLC_CUSTOM","BLC_DIRECTORY","BLC_EXTERNAL","BLC_HTML","BLC_INTERNAL","BLC_INVALID","BLC_KEYWORD","BLC_ROBOTS","BLC_SAMEPAGE","BLC_UNKNOWN","BLC_UNSUPPORTED","ERRNO_ENOTFOUND","fromEntries","ERRNO","map","code","description","entries","HTTP","key","value","module"],"sources":["../../lib/internal/reasons.js"],"sourcesContent":["import {all as ERRNO} from \"errno\";\nimport {STATUS_CODES as HTTP} from \"http\";\n\n\n\nexport default Object.freeze(\n{\n\tBLC_CUSTOM: \"Custom exclusion\",\n\tBLC_DIRECTORY: \"File system directory exclusion\",\n\tBLC_EXTERNAL: \"External URL exclusion\",\n\tBLC_HTML: \"HTML exclusion\",\n\tBLC_INTERNAL: \"Internal URL exclusion\",\n\tBLC_INVALID: \"Invalid URL\",\n\tBLC_KEYWORD: \"Keyword exclusion\",\n\tBLC_ROBOTS: \"Robots exclusion\",\n\tBLC_SAMEPAGE: \"Same-Page URL exclusion\",\n\tBLC_UNKNOWN: \"Unknown error\",\n\tBLC_UNSUPPORTED: \"Unsupported URL\",\n\n\t// https://github.com/rvagg/node-errno/issues/14\n\tERRNO_ENOTFOUND: \"no matching dns record (ENOTFOUND)\",\n\n\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t...Object.fromEntries\n\t(\n\t\tERRNO.map(({code, description}) => [`ERRNO_${code}`, `${description} (${code})`])\n\t),\n\n\t// @todo https://github.com/tc39/proposal-pipeline-operator\n\t...Object.fromEntries\n\t(\n\t\tObject.entries(HTTP).map(([key, value]) => [`HTTP_${key}`, `${value} (${key})`])\n\t)\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAA0C,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAI3BC,MAAM,CAACC,MAAM,CAC5B;EACCC,UAAU,EAAE,kBAAkB;EAC9BC,aAAa,EAAE,iCAAiC;EAChDC,YAAY,EAAE,wBAAwB;EACtCC,QAAQ,EAAE,gBAAgB;EAC1BC,YAAY,EAAE,wBAAwB;EACtCC,WAAW,EAAE,aAAa;EAC1BC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,YAAY,EAAE,yBAAyB;EACvCC,WAAW,EAAE,eAAe;EAC5BC,eAAe,EAAE,iBAAiB;EAElC;EACAC,eAAe,EAAE,oCAAoC;EAErD;EACA,GAAGb,MAAM,CAACc,WAAW,CAEpBC,UAAK,CAACC,GAAG,CAAC,CAAC;IAACC,IAAI;IAAEC;EAAW,CAAC,KAAK,CAAE,SAAQD,IAAK,EAAC,EAAG,GAAEC,WAAY,KAAID,IAAK,GAAE,CAAC,CACjF,CAAC;EAED;EACA,GAAGjB,MAAM,CAACc,WAAW,CAEpBd,MAAM,CAACmB,OAAO,CAACC,kBAAI,CAAC,CAACJ,GAAG,CAAC,CAAC,CAACK,GAAG,EAAEC,KAAK,CAAC,KAAK,CAAE,QAAOD,GAAI,EAAC,EAAG,GAAEC,KAAM,KAAID,GAAI,GAAE,CAAC,CAChF;AACD,CAAC,CAAC;AAAAE,MAAA,CAAAzB,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/scrapeHTML.js b/lib-cjs/internal/scrapeHTML.js
deleted file mode 100644
index ae42debc..00000000
--- a/lib-cjs/internal/scrapeHTML.js
+++ /dev/null
@@ -1,269 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _condenseWhitespace = _interopRequireDefault(require("condense-whitespace"));
-var _Link = _interopRequireWildcard(require("./Link"));
-var _httpEquivRefresh = _interopRequireDefault(require("http-equiv-refresh"));
-var _parseSrcset = _interopRequireDefault(require("parse-srcset"));
-var _robotDirectives = _interopRequireDefault(require("robot-directives"));
-var _tags = _interopRequireDefault(require("./tags"));
-var _walkParse = _interopRequireDefault(require("walk-parse5"));
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-const MAX_FILTER_LEVEL = _tags.default[_tags.default.length - 1];
-const ALL_NODE_ATTRS = MAX_FILTER_LEVEL["*"];
-const SPECIAL_NODE_NAME_PREFIX = "#";
-const BASE_NODE_NAME = "base";
-const BODY_NODE_NAME = "body";
-const COMMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}comment`;
-const DOCUMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}document`;
-const HEAD_NODE_NAME = "head";
-const HTML_NODE_NAME = "html";
-const META_NODE_NAME = "meta";
-const TEXT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}text`;
-const CONTENT_ATTR_NAME = "content";
-const HREF_ATTR_NAME = "href";
-const HTTP_EQUIV_ATTR_NAME = "http-equiv";
-const NAME_ATTR_NAME = "name";
-const PING_ATTR_NAME = "ping";
-const SRCSET_ATTR_NAME = "srcset";
-const REFRESH_ATTR_VALUE = "refresh";
-const ROBOTS_ATTR_VALUE = "robots";
-
-/**
- * Traverse the root node (synchronously) and return located links via a callback function.
- * @param {object} rootNode
- * @param {Function} callback
- */
-const findLinks = (rootNode, callback) => {
-  (0, _walkParse.default)(rootNode, node => {
-    if (node.nodeName !== COMMENT_NODE_NAME && node.nodeName !== TEXT_NODE_NAME) {
-      const filteredNodeAttrs = MAX_FILTER_LEVEL[node.nodeName] ?? {};
-      node.attrs.forEach(({
-        name: attrName,
-        value: attrValue
-      }) => {
-        let url = null;
-
-        // If a supported attribute
-        if (attrName in filteredNodeAttrs || attrName in ALL_NODE_ATTRS) {
-          switch (attrName) {
-            case CONTENT_ATTR_NAME:
-              {
-                var _node$attrMap$HTTP_EQ;
-                // Special case for ``
-                // No browser supports a value surrounded by spaces, so `trim()` is not used
-                if (((_node$attrMap$HTTP_EQ = node.attrMap[HTTP_EQUIV_ATTR_NAME]) === null || _node$attrMap$HTTP_EQ === void 0 ? void 0 : _node$attrMap$HTTP_EQ.toLowerCase()) === REFRESH_ATTR_VALUE) {
-                  url = (0, _httpEquivRefresh.default)(attrValue).url;
-                }
-                break;
-              }
-            case PING_ATTR_NAME:
-              {
-                url = attrValue.split(" ").filter(pingURL => pingURL !== "");
-                break;
-              }
-            case SRCSET_ATTR_NAME:
-              {
-                url = (0, _parseSrcset.default)(attrValue).map(image => image.url);
-                break;
-              }
-            default:
-              {
-                // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces
-                url = attrValue.trim();
-              }
-          }
-          if (Array.isArray(url)) {
-            url.forEach(_url => callback(node, attrName, _url));
-          } else if (url != null) {
-            callback(node, attrName, url);
-          }
-        }
-      });
-    }
-  });
-};
-
-/**
- * Traverse the root node to locate preliminary elements/data.
- *
- * 
- *
- * 	Looks for the first instance. If no `href` attribute exists,
- * 	the element is ignored and possible successors are considered.
- *
- * 
- *
- * 	Looks for all robot instances and cascades the values.
- *
- * @param {object} rootNode
- * @param {RobotDirectives} robots
- * @returns {object}
- */
-const findPreliminaries = (rootNode, robots) => {
-  const result = {
-    base: null
-  };
-  (0, _walkParse.default)(rootNode, ({
-    attrMap,
-    nodeName
-  }) => {
-    switch (nodeName) {
-      // `` can be anywhere, not just within ``
-      case BASE_NODE_NAME:
-        {
-          if (result.base === null && HREF_ATTR_NAME in attrMap) {
-            // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces
-            result.base = attrMap[HREF_ATTR_NAME].trim();
-          }
-          break;
-        }
-      // `` can be anywhere
-      case META_NODE_NAME:
-        {
-          if (robots && NAME_ATTR_NAME in attrMap && CONTENT_ATTR_NAME in attrMap) {
-            const name = attrMap[NAME_ATTR_NAME].trim().toLowerCase();
-            if (name === ROBOTS_ATTR_VALUE || _robotDirectives.default.isBot(name)) {
-              robots.meta(name, attrMap[CONTENT_ATTR_NAME]);
-            }
-          }
-          break;
-        }
-    }
-    if (result.base !== null && !robots) {
-      // Kill walk
-      return false;
-    }
-  });
-  return result;
-};
-
-/**
- * Find the `` element.
- * @param {object} document
- * @returns {object}
- */
-const findRootNode = document => document.childNodes.find(childNode => {
-  // Doctypes have no `childNodes` property
-  // HTML can only have one true root node
-  if (childNode.childNodes != null) {
-    return childNode;
-  }
-});
-
-/**
- * Find a node's `:nth-child()` index among its siblings.
- * @param {object} node
- * @returns {number}
- */
-const getNthIndex = node => {
-  const parentsChildren = node.parentNode.childNodes;
-  let count = 0;
-  parentsChildren.every(child => {
-    if (child !== node) {
-      // Exclude non-element nodes
-      if (!child.nodeName.startsWith(SPECIAL_NODE_NAME_PREFIX)) {
-        count++;
-      }
-      return true;
-    } else {
-      return false;
-    }
-  });
-
-  // `:nth-child()` indices don't start at 0
-  return count + 1;
-};
-
-/**
- * Produces a CSS selector that matches an element.
- * @param {object} node
- * @returns {string}
- */
-const getSelector = node => {
-  const selector = [];
-  while (node.nodeName !== DOCUMENT_NODE_NAME) {
-    let name = node.nodeName;
-
-    // Only one of these are ever allowed per document -- so, index is unnecessary
-    if (name !== HTML_NODE_NAME && name !== BODY_NODE_NAME & name !== HEAD_NODE_NAME) {
-      name += `:nth-child(${getNthIndex(node)})`;
-    }
-
-    // Building backwards
-    selector.push(name);
-    node = node.parentNode;
-  }
-  return selector.reverse().join(" > ");
-};
-
-/**
- * Produces an `innerText` value for text nodes within an element.
- * @param {object} node
- * @returns {string|null}
- */
-const getText = node => {
-  let text = null;
-  if (node.childNodes.length > 0) {
-    text = "";
-    (0, _walkParse.default)(node, ({
-      nodeName,
-      value
-    }) => {
-      if (nodeName === TEXT_NODE_NAME) {
-        text += value;
-      }
-    });
-
-    // @todo don't normalize if within 
 ? use "normalize-html-whitespace" package if so
-    text = (0, _condenseWhitespace.default)(text);
-  }
-  return text;
-};
-
-/**
- * Serialize an HTML element into a string.
- * @param {object} node
- * @returns {string}
- */
-const stringifyNode = ({
-  attrs,
-  nodeName
-}) => {
-  const attrsString = attrs.reduce((result, {
-    name,
-    value
-  }) => `${result} ${name}="${value}"`, "");
-  return `<${nodeName}${attrsString}>`;
-};
-
-/**
- * Scrape a parsed HTML document/tree for links.
- * @param {object} document
- * @param {URL|string} pageURL
- * @param {RobotDirectives} robots
- * @returns {Array}
- */
-var _default = (document, pageURL, robots) => {
-  const links = [];
-  const rootNode = findRootNode(document);
-  const {
-    base
-  } = findPreliminaries(rootNode, robots);
-  findLinks(rootNode, (node, attrName, url) => {
-    var _node$sourceCodeLocat;
-    // Elements added for compliance (not from HTML source) have no location
-    const location = ((_node$sourceCodeLocat = node.sourceCodeLocation) === null || _node$sourceCodeLocat === void 0 ? void 0 : _node$sourceCodeLocat.attrs[attrName]) ?? null;
-    const link = new _Link.default().set(_Link.HTML_ATTR_NAME, attrName).set(_Link.HTML_ATTRS, node.attrMap).set(_Link.HTML_BASE_HREF, base).set(_Link.HTML_INDEX, links.length).set(_Link.HTML_LOCATION, location).set(_Link.HTML_SELECTOR, getSelector(node)).set(_Link.HTML_TAG, stringifyNode(node)).set(_Link.HTML_TAG_NAME, node.nodeName).set(_Link.HTML_TEXT, getText(node)).resolve(url, pageURL);
-    links.push(link);
-  });
-  return links;
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=scrapeHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/scrapeHTML.js.map b/lib-cjs/internal/scrapeHTML.js.map
deleted file mode 100644
index 0753da69..00000000
--- a/lib-cjs/internal/scrapeHTML.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"scrapeHTML.js","names":["_condenseWhitespace","_interopRequireDefault","require","_Link","_interopRequireWildcard","_httpEquivRefresh","_parseSrcset","_robotDirectives","_tags","_walkParse","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","MAX_FILTER_LEVEL","TAGS","length","ALL_NODE_ATTRS","SPECIAL_NODE_NAME_PREFIX","BASE_NODE_NAME","BODY_NODE_NAME","COMMENT_NODE_NAME","DOCUMENT_NODE_NAME","HEAD_NODE_NAME","HTML_NODE_NAME","META_NODE_NAME","TEXT_NODE_NAME","CONTENT_ATTR_NAME","HREF_ATTR_NAME","HTTP_EQUIV_ATTR_NAME","NAME_ATTR_NAME","PING_ATTR_NAME","SRCSET_ATTR_NAME","REFRESH_ATTR_VALUE","ROBOTS_ATTR_VALUE","findLinks","rootNode","callback","walk","node","nodeName","filteredNodeAttrs","attrs","forEach","name","attrName","value","attrValue","url","_node$attrMap$HTTP_EQ","attrMap","toLowerCase","parseMetaRefresh","split","filter","pingURL","parseSrcset","map","image","trim","Array","isArray","_url","findPreliminaries","robots","result","base","RobotDirectives","isBot","meta","findRootNode","document","childNodes","find","childNode","getNthIndex","parentsChildren","parentNode","count","every","child","startsWith","getSelector","selector","push","reverse","join","getText","text","condenseWhitespace","stringifyNode","attrsString","reduce","_default","pageURL","links","_node$sourceCodeLocat","location","sourceCodeLocation","link","Link","HTML_ATTR_NAME","HTML_ATTRS","HTML_BASE_HREF","HTML_INDEX","HTML_LOCATION","HTML_SELECTOR","HTML_TAG","HTML_TAG_NAME","HTML_TEXT","resolve","exports","module"],"sources":["../../lib/internal/scrapeHTML.js"],"sourcesContent":["import condenseWhitespace from \"condense-whitespace\";\nimport Link, {HTML_ATTR_NAME, HTML_ATTRS, HTML_BASE_HREF, HTML_INDEX, HTML_LOCATION, HTML_SELECTOR, HTML_TAG, HTML_TAG_NAME, HTML_TEXT} from \"./Link\";\nimport parseMetaRefresh from \"http-equiv-refresh\";\nimport parseSrcset from \"parse-srcset\";\nimport RobotDirectives from \"robot-directives\";\nimport TAGS from \"./tags\";\nimport walk from \"walk-parse5\";\n\n\n\nconst MAX_FILTER_LEVEL = TAGS[TAGS.length - 1];\nconst ALL_NODE_ATTRS = MAX_FILTER_LEVEL[\"*\"];\n\nconst SPECIAL_NODE_NAME_PREFIX = \"#\";\n\nconst BASE_NODE_NAME = \"base\";\nconst BODY_NODE_NAME = \"body\";\nconst COMMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}comment`;\nconst DOCUMENT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}document`;\nconst HEAD_NODE_NAME = \"head\";\nconst HTML_NODE_NAME = \"html\";\nconst META_NODE_NAME = \"meta\";\nconst TEXT_NODE_NAME = `${SPECIAL_NODE_NAME_PREFIX}text`;\n\nconst CONTENT_ATTR_NAME = \"content\";\nconst HREF_ATTR_NAME = \"href\";\nconst HTTP_EQUIV_ATTR_NAME = \"http-equiv\";\nconst NAME_ATTR_NAME = \"name\";\nconst PING_ATTR_NAME = \"ping\";\nconst SRCSET_ATTR_NAME = \"srcset\";\n\nconst REFRESH_ATTR_VALUE = \"refresh\";\nconst ROBOTS_ATTR_VALUE = \"robots\";\n\n\n\n/**\n * Traverse the root node (synchronously) and return located links via a callback function.\n * @param {object} rootNode\n * @param {Function} callback\n */\nconst findLinks = (rootNode, callback) =>\n{\n\twalk(rootNode, node =>\n\t{\n\t\tif (node.nodeName!==COMMENT_NODE_NAME && node.nodeName!==TEXT_NODE_NAME)\n\t\t{\n\t\t\tconst filteredNodeAttrs = MAX_FILTER_LEVEL[node.nodeName] ?? {};\n\n\t\t\tnode.attrs.forEach(({name:attrName, value:attrValue}) =>\n\t\t\t{\n\t\t\t\tlet url = null;\n\n\t\t\t\t// If a supported attribute\n\t\t\t\tif (attrName in filteredNodeAttrs || attrName in ALL_NODE_ATTRS)\n\t\t\t\t{\n\t\t\t\t\tswitch (attrName)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase CONTENT_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Special case for ``\n\t\t\t\t\t\t\t// No browser supports a value surrounded by spaces, so `trim()` is not used\n\t\t\t\t\t\t\tif (node.attrMap[HTTP_EQUIV_ATTR_NAME]?.toLowerCase() === REFRESH_ATTR_VALUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl = parseMetaRefresh(attrValue).url;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase PING_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl = attrValue.split(\" \").filter(pingURL => pingURL !== \"\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase SRCSET_ATTR_NAME:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl = parseSrcset(attrValue).map(image => image.url);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces\n\t\t\t\t\t\t\turl = attrValue.trim();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Array.isArray(url))\n\t\t\t\t\t{\n\t\t\t\t\t\turl.forEach(_url => callback(node, attrName, _url));\n\t\t\t\t\t}\n\t\t\t\t\telse if (url != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcallback(node, attrName, url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n};\n\n\n\n/**\n * Traverse the root node to locate preliminary elements/data.\n *\n * \n *\n * \tLooks for the first instance. If no `href` attribute exists,\n * \tthe element is ignored and possible successors are considered.\n *\n * \n *\n * \tLooks for all robot instances and cascades the values.\n *\n * @param {object} rootNode\n * @param {RobotDirectives} robots\n * @returns {object}\n */\nconst findPreliminaries = (rootNode, robots) =>\n{\n\tconst result = { base:null };\n\n\twalk(rootNode, ({attrMap, nodeName}) =>\n\t{\n\t\tswitch (nodeName)\n\t\t{\n\t\t\t// `` can be anywhere, not just within ``\n\t\t\tcase BASE_NODE_NAME:\n\t\t\t{\n\t\t\t\tif (result.base===null && HREF_ATTR_NAME in attrMap)\n\t\t\t\t{\n\t\t\t\t\t// https://html.spec.whatwg.org/multipage/infrastructure.html#valid-url-potentially-surrounded-by-spaces\n\t\t\t\t\tresult.base = attrMap[HREF_ATTR_NAME].trim();\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// `` can be anywhere\n\t\t\tcase META_NODE_NAME:\n\t\t\t{\n\t\t\t\tif (robots && NAME_ATTR_NAME in attrMap && CONTENT_ATTR_NAME in attrMap)\n\t\t\t\t{\n\t\t\t\t\tconst name = attrMap[NAME_ATTR_NAME].trim().toLowerCase();\n\n\t\t\t\t\tif (name===ROBOTS_ATTR_VALUE || RobotDirectives.isBot(name))\n\t\t\t\t\t{\n\t\t\t\t\t\trobots.meta(name, attrMap[CONTENT_ATTR_NAME]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (result.base!==null && !robots)\n\t\t{\n\t\t\t// Kill walk\n\t\t\treturn false;\n\t\t}\n\t});\n\n\treturn result;\n};\n\n\n\n/**\n * Find the `` element.\n * @param {object} document\n * @returns {object}\n */\nconst findRootNode = document => document.childNodes.find(childNode =>\n{\n\t// Doctypes have no `childNodes` property\n\t// HTML can only have one true root node\n\tif (childNode.childNodes != null)\n\t{\n\t\treturn childNode;\n\t}\n});\n\n\n\n/**\n * Find a node's `:nth-child()` index among its siblings.\n * @param {object} node\n * @returns {number}\n */\nconst getNthIndex = node =>\n{\n\tconst parentsChildren = node.parentNode.childNodes;\n\tlet count = 0;\n\n\tparentsChildren.every(child =>\n\t{\n\t\tif (child !== node)\n\t\t{\n\t\t\t// Exclude non-element nodes\n\t\t\tif (!child.nodeName.startsWith(SPECIAL_NODE_NAME_PREFIX))\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t});\n\n\t// `:nth-child()` indices don't start at 0\n\treturn count + 1;\n};\n\n\n\n/**\n * Produces a CSS selector that matches an element.\n * @param {object} node\n * @returns {string}\n */\nconst getSelector = node =>\n{\n\tconst selector = [];\n\n\twhile (node.nodeName !== DOCUMENT_NODE_NAME)\n\t{\n\t\tlet name = node.nodeName;\n\n\t\t// Only one of these are ever allowed per document -- so, index is unnecessary\n\t\tif (name!==HTML_NODE_NAME && name!==BODY_NODE_NAME & name!==HEAD_NODE_NAME)\n\t\t{\n\t\t\tname += `:nth-child(${getNthIndex(node)})`;\n\t\t}\n\n\t\t// Building backwards\n\t\tselector.push(name);\n\n\t\tnode = node.parentNode;\n\t}\n\n\treturn selector.reverse().join(\" > \");\n};\n\n\n\n/**\n * Produces an `innerText` value for text nodes within an element.\n * @param {object} node\n * @returns {string|null}\n */\nconst getText = node =>\n{\n\tlet text = null;\n\n\tif (node.childNodes.length > 0)\n\t{\n\t\ttext = \"\";\n\n\t\twalk(node, ({nodeName, value}) =>\n\t\t{\n\t\t\tif (nodeName === TEXT_NODE_NAME)\n\t\t\t{\n\t\t\t\ttext += value;\n\t\t\t}\n\t\t});\n\n\t\t// @todo don't normalize if within 
 ? use \"normalize-html-whitespace\" package if so\n\t\ttext = condenseWhitespace(text);\n\t}\n\n\treturn text;\n};\n\n\n\n/**\n * Serialize an HTML element into a string.\n * @param {object} node\n * @returns {string}\n */\nconst stringifyNode = ({attrs, nodeName}) =>\n{\n\tconst attrsString = attrs.reduce((result, {name, value}) => `${result} ${name}=\"${value}\"`, \"\");\n\n\treturn `<${nodeName}${attrsString}>`;\n};\n\n\n\n/**\n * Scrape a parsed HTML document/tree for links.\n * @param {object} document\n * @param {URL|string} pageURL\n * @param {RobotDirectives} robots\n * @returns {Array}\n */\nexport default (document, pageURL, robots) =>\n{\n\tconst links = [];\n\tconst rootNode = findRootNode(document);\n\tconst {base} = findPreliminaries(rootNode, robots);\n\n\tfindLinks(rootNode, (node, attrName, url) =>\n\t{\n\t\t// Elements added for compliance (not from HTML source) have no location\n\t\tconst location = node.sourceCodeLocation?.attrs[attrName] ?? null;\n\n\t\tconst link = new Link()\n\t\t.set(HTML_ATTR_NAME, attrName)\n\t\t.set(HTML_ATTRS, node.attrMap)\n\t\t.set(HTML_BASE_HREF, base)\n\t\t.set(HTML_INDEX, links.length)\n\t\t.set(HTML_LOCATION, location)\n\t\t.set(HTML_SELECTOR, getSelector(node))\n\t\t.set(HTML_TAG, stringifyNode(node))\n\t\t.set(HTML_TAG_NAME, node.nodeName)\n\t\t.set(HTML_TEXT, getText(node))\n\t\t.resolve(url, pageURL);\n\n\t\tlinks.push(link);\n\t});\n\n\treturn links;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAJ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MAAMsD,IAAI,GAAG,IAAIC,aAAI,CAAC,CAAC,CACtBxF,GAAG,CAACyF,oBAAc,EAAExD,QAAQ,CAAC,CAC7BjC,GAAG,CAAC0F,gBAAU,EAAE/D,IAAI,CAACW,OAAO,CAAC,CAC7BtC,GAAG,CAAC2F,oBAAc,EAAErC,IAAI,CAAC,CACzBtD,GAAG,CAAC4F,gBAAU,EAAET,KAAK,CAAC/E,MAAM,CAAC,CAC7BJ,GAAG,CAAC6F,mBAAa,EAAER,QAAQ,CAAC,CAC5BrF,GAAG,CAAC8F,mBAAa,EAAExB,WAAW,CAAC3C,IAAI,CAAC,CAAC,CACrC3B,GAAG,CAAC+F,cAAQ,EAAEjB,aAAa,CAACnD,IAAI,CAAC,CAAC,CAClC3B,GAAG,CAACgG,mBAAa,EAAErE,IAAI,CAACC,QAAQ,CAAC,CACjC5B,GAAG,CAACiG,eAAS,EAAEtB,OAAO,CAAChD,IAAI,CAAC,CAAC,CAC7BuE,OAAO,CAAC9D,GAAG,EAAE8C,OAAO,CAAC;IAEtBC,KAAK,CAACX,IAAI,CAACe,IAAI,CAAC;EACjB,CAAC,CAAC;EAEF,OAAOJ,KAAK;AACb,CAAC;AAAAgB,OAAA,CAAAjH,OAAA,GAAA+F,QAAA;AAAAmB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjH,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/streamHTML.js b/lib-cjs/internal/streamHTML.js
deleted file mode 100644
index c0ca4c8c..00000000
--- a/lib-cjs/internal/streamHTML.js
+++ /dev/null
@@ -1,40 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _reasons = require("./reasons");
-var _httpProtocol = require("./http-protocol");
-var _isurl = _interopRequireDefault(require("isurl"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-//import {isCompatibleScheme as isFileScheme, streamHTML as streamHTMLFromFile} from "./file-protocol";
-/**
- * Retreive HTML contents from a URL.
- * @param {URL} url
- * @param {object} auth
- * @param {URLCache} cache
- * @param {object} options
- * @throws {ExpectedHTMLError} if not HTML media type
- * @throws {HTMLRetrievalError} 404, etc
- * @throws {TypeError} non-URL
- * @returns {Promise}
- */
-var _default = async (url, auth, cache, options) => {
-  if (!(0, _isurl.default)(url)) {
-    throw new TypeError(_reasons.BLC_INVALID);
-  } else {
-    /*if (isFileScheme(url))
-    {
-    	const stream = await streamHTMLFromFile(url);
-    	return {stream};
-    }
-    else if (isHTTPScheme(url))
-    {*/
-    return (0, _httpProtocol.streamHTML)(url, auth, cache, options);
-    //}
-  }
-};
-exports.default = _default;
-module.exports = exports.default;
-//# sourceMappingURL=streamHTML.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/streamHTML.js.map b/lib-cjs/internal/streamHTML.js.map
deleted file mode 100644
index 74c6fbe7..00000000
--- a/lib-cjs/internal/streamHTML.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"streamHTML.js","names":["_reasons","require","_httpProtocol","_isurl","_interopRequireDefault","obj","__esModule","default","_default","url","auth","cache","options","isURL","TypeError","BLC_INVALID","streamHTMLFromHTTP","exports","module"],"sources":["../../lib/internal/streamHTML.js"],"sourcesContent":["import {BLC_INVALID} from \"./reasons\";\n//import {isCompatibleScheme as isFileScheme, streamHTML as streamHTMLFromFile} from \"./file-protocol\";\nimport {/*isCompatibleScheme as isHTTPScheme, */streamHTML as streamHTMLFromHTTP} from \"./http-protocol\";\nimport isURL from \"isurl\";\n\n\n\n/**\n * Retreive HTML contents from a URL.\n * @param {URL} url\n * @param {object} auth\n * @param {URLCache} cache\n * @param {object} options\n * @throws {ExpectedHTMLError} if not HTML media type\n * @throws {HTMLRetrievalError} 404, etc\n * @throws {TypeError} non-URL\n * @returns {Promise}\n */\nexport default async (url, auth, cache, options) =>\n{\n\tif (!isURL(url))\n\t{\n\t\tthrow new TypeError(BLC_INVALID);\n\t}\n\telse\n\t{\n\t\t/*if (isFileScheme(url))\n\t\t{\n\t\t\tconst stream = await streamHTMLFromFile(url);\n\t\t\treturn {stream};\n\t\t}\n\t\telse if (isHTTPScheme(url))\n\t\t{*/\n\t\t\treturn streamHTMLFromHTTP(url, auth, cache, options);\n\t\t//}\n\t}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0B,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF1B;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAG,QAAA,GAWe,MAAAA,CAAOC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,KAC/C;EACC,IAAI,CAAC,IAAAC,cAAK,EAACJ,GAAG,CAAC,EACf;IACC,MAAM,IAAIK,SAAS,CAACC,oBAAW,CAAC;EACjC,CAAC,MAED;IACC;AACF;AACA;AACA;AACA;AACA;AACA;IACG,OAAO,IAAAC,wBAAkB,EAACP,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;IACrD;EACD;AACD,CAAC;AAAAK,OAAA,CAAAV,OAAA,GAAAC,QAAA;AAAAU,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAV,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/internal/tags.js b/lib-cjs/internal/tags.js
deleted file mode 100644
index b20219d5..00000000
--- a/lib-cjs/internal/tags.js
+++ /dev/null
@@ -1,221 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _deepFreezeNode = _interopRequireDefault(require("deep-freeze-node"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Clickable links
-const flatLevel0 = {
-  a: {
-    href: true
-  },
-  area: {
-    href: true
-  }
-};
-
-// Clickable links, media, frames, meta refreshes
-const flatLevel1 = {
-  ...flatLevel0,
-  applet: {
-    archive: true,
-    code: true,
-    src: true
-  },
-  audio: {
-    src: true
-  },
-  body: {
-    background: true
-  },
-  embed: {
-    src: true
-  },
-  frame: {
-    src: true
-  },
-  iframe: {
-    src: true
-  },
-  img: {
-    src: true,
-    srcset: true
-  },
-  input: {
-    src: true
-  },
-  menuitem: {
-    icon: true
-  },
-  meta: {
-    content: true
-  },
-  object: {
-    data: true
-  },
-  source: {
-    src: true,
-    srcset: true
-  },
-  table: {
-    background: true
-  },
-  tbody: {
-    background: true
-  },
-  td: {
-    background: true
-  },
-  tfoot: {
-    background: true
-  },
-  th: {
-    background: true
-  },
-  thead: {
-    background: true
-  },
-  tr: {
-    background: true
-  },
-  track: {
-    src: true
-  },
-  video: {
-    poster: true,
-    src: true
-  }
-};
-
-// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms
-const flatLevel2 = {
-  ...flatLevel1,
-  button: {
-    formaction: true
-  },
-  form: {
-    action: true
-  },
-  input: {
-    formaction: true,
-    ...flatLevel1.input
-  },
-  link: {
-    href: true
-  },
-  script: {
-    src: true
-  }
-};
-
-// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms, metadata
-const flatLevel3 = {
-  ...flatLevel2,
-  "*": {
-    itemtype: true
-  },
-  a: {
-    ping: true,
-    ...flatLevel2.a
-  },
-  applet: {
-    codebase: true,
-    object: true,
-    ...flatLevel2.applet
-  },
-  area: {
-    ping: true,
-    ...flatLevel2.area
-  },
-  blockquote: {
-    cite: true
-  },
-  del: {
-    cite: true
-  },
-  frame: {
-    longdesc: true,
-    ...flatLevel2.frame
-  },
-  head: {
-    profile: true
-  },
-  html: {
-    manifest: true
-  },
-  iframe: {
-    longdesc: true,
-    ...flatLevel2.iframe
-  },
-  img: {
-    longdesc: true,
-    ...flatLevel2.img
-  },
-  ins: {
-    cite: true
-  },
-  object: {
-    codebase: true,
-    ...flatLevel2.object
-  },
-  q: {
-    cite: true
-  }
-};
-const recursiveLevel0 = flatLevel0;
-const recursiveLevel1 = {
-  ...recursiveLevel0,
-  iframe: {
-    src: true
-  },
-  meta: {
-    content: true
-  }
-};
-const recursiveLevel2 = recursiveLevel1;
-const recursiveLevel3 = {
-  ...recursiveLevel2,
-  blockquote: {
-    cite: true
-  },
-  del: {
-    cite: true
-  },
-  frame: {
-    longdesc: true
-  },
-  iframe: {
-    longdesc: true,
-    ...recursiveLevel2.iframe
-  },
-  img: {
-    longdesc: true
-  },
-  ins: {
-    cite: true
-  },
-  q: {
-    cite: true
-  }
-};
-var _default = exports.default = (0, _deepFreezeNode.default)({
-  0: flatLevel0,
-  1: flatLevel1,
-  2: flatLevel2,
-  3: flatLevel3,
-  length: 4,
-  // simulate Array
-
-  recursive:
-  // only used for `SiteChecker`
-  {
-    0: recursiveLevel0,
-    1: recursiveLevel1,
-    2: recursiveLevel2,
-    3: recursiveLevel3
-  }
-});
-module.exports = exports.default;
-//# sourceMappingURL=tags.js.map
\ No newline at end of file
diff --git a/lib-cjs/internal/tags.js.map b/lib-cjs/internal/tags.js.map
deleted file mode 100644
index e6ed7673..00000000
--- a/lib-cjs/internal/tags.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tags.js","names":["_deepFreezeNode","_interopRequireDefault","require","obj","__esModule","default","flatLevel0","a","href","area","flatLevel1","applet","archive","code","src","audio","body","background","embed","frame","iframe","img","srcset","input","menuitem","icon","meta","content","object","data","source","table","tbody","td","tfoot","th","thead","tr","track","video","poster","flatLevel2","button","formaction","form","action","link","script","flatLevel3","itemtype","ping","codebase","blockquote","cite","del","longdesc","head","profile","html","manifest","ins","q","recursiveLevel0","recursiveLevel1","recursiveLevel2","recursiveLevel3","_default","exports","deepFreeze","length","recursive","module"],"sources":["../../lib/internal/tags.js"],"sourcesContent":["import deepFreeze from \"deep-freeze-node\";\n\n\n\n// Clickable links\nconst flatLevel0 =\n{\n\ta:      { href:true },\n\tarea:   { href:true }\n};\n\n// Clickable links, media, frames, meta refreshes\nconst flatLevel1 =\n{\n\t...flatLevel0,\n\tapplet:   { archive:true, code:true, src:true },\n\taudio:    { src:true },\n\tbody:     { background:true },\n\tembed:    { src:true },\n\tframe:    { src:true },\n\tiframe:   { src:true },\n\timg:      { src:true, srcset:true },\n\tinput:    { src:true },\n\tmenuitem: { icon:true },\n\tmeta:     { content:true },\n\tobject:   { data:true },\n\tsource:   { src:true, srcset:true },\n\ttable:    { background:true },\n\ttbody:    { background:true },\n\ttd:       { background:true },\n\ttfoot:    { background:true },\n\tth:       { background:true },\n\tthead:    { background:true },\n\ttr:       { background:true },\n\ttrack:    { src:true },\n\tvideo:    { poster:true, src:true }\n};\n\n// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms\nconst flatLevel2 =\n{\n\t...flatLevel1,\n\tbutton: { formaction:true },\n\tform:   { action:true },\n\tinput:  { formaction:true, ...flatLevel1.input },\n\tlink:   { href:true },\n\tscript: { src:true }\n};\n\n// Clickable links, media, frames, meta refreshes, stylesheets, scripts, forms, metadata\nconst flatLevel3 =\n{\n\t...flatLevel2,\n\t\"*\":        { itemtype:true },\n\ta:          { ping:true, ...flatLevel2.a },\n\tapplet:     { codebase:true, object:true, ...flatLevel2.applet },\n\tarea:       { ping:true, ...flatLevel2.area },\n\tblockquote: { cite:true },\n\tdel:        { cite:true },\n\tframe:      { longdesc:true, ...flatLevel2.frame },\n\thead:       { profile:true },\n\thtml:       { manifest:true },\n\tiframe:     { longdesc:true, ...flatLevel2.iframe },\n\timg:        { longdesc:true, ...flatLevel2.img },\n\tins:        { cite:true },\n\tobject:     { codebase:true, ...flatLevel2.object },\n\tq:          { cite:true }\n};\n\n\n\nconst recursiveLevel0 = flatLevel0;\n\nconst recursiveLevel1 =\n{\n\t...recursiveLevel0,\n\tiframe: { src:true },\n\tmeta:   { content:true }\n};\n\nconst recursiveLevel2 = recursiveLevel1;\n\nconst recursiveLevel3 =\n{\n\t...recursiveLevel2,\n\tblockquote: { cite:true },\n\tdel:        { cite:true },\n\tframe:      { longdesc:true },\n\tiframe:     { longdesc:true, ...recursiveLevel2.iframe },\n\timg:        { longdesc:true },\n\tins:        { cite:true },\n\tq:          { cite:true }\n};\n\n\n\nexport default deepFreeze(\n{\n\t0: flatLevel0,\n\t1: flatLevel1,\n\t2: flatLevel2,\n\t3: flatLevel3,\n\tlength: 4,  // simulate Array\n\n\trecursive:  // only used for `SiteChecker`\n\t{\n\t\t0: recursiveLevel0,\n\t\t1: recursiveLevel1,\n\t\t2: recursiveLevel2,\n\t\t3: recursiveLevel3\n\t}\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1C;AACA,MAAMG,UAAU,GAChB;EACCC,CAAC,EAAO;IAAEC,IAAI,EAAC;EAAK,CAAC;EACrBC,IAAI,EAAI;IAAED,IAAI,EAAC;EAAK;AACrB,CAAC;;AAED;AACA,MAAME,UAAU,GAChB;EACC,GAAGJ,UAAU;EACbK,MAAM,EAAI;IAAEC,OAAO,EAAC,IAAI;IAAEC,IAAI,EAAC,IAAI;IAAEC,GAAG,EAAC;EAAK,CAAC;EAC/CC,KAAK,EAAK;IAAED,GAAG,EAAC;EAAK,CAAC;EACtBE,IAAI,EAAM;IAAEC,UAAU,EAAC;EAAK,CAAC;EAC7BC,KAAK,EAAK;IAAEJ,GAAG,EAAC;EAAK,CAAC;EACtBK,KAAK,EAAK;IAAEL,GAAG,EAAC;EAAK,CAAC;EACtBM,MAAM,EAAI;IAAEN,GAAG,EAAC;EAAK,CAAC;EACtBO,GAAG,EAAO;IAAEP,GAAG,EAAC,IAAI;IAAEQ,MAAM,EAAC;EAAK,CAAC;EACnCC,KAAK,EAAK;IAAET,GAAG,EAAC;EAAK,CAAC;EACtBU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AAS;IAAED,IAAI,EAAC;EAAK,CAAC;EACzBlC,KAAK,EAAO;IAAEoC,QAAQ,EAAC;EAAK,CAAC;EAC7BnC,MAAM,EAAM;IAAEmC,QAAQ,EAAC,IAAI;IAAE,GAAGS,eAAe,CAAC5C;EAAO,CAAC;EACxDC,GAAG,EAAS;IAAEkC,QAAQ,EAAC;EAAK,CAAC;EAC7BK,GAAG,EAAS;IAAEP,IAAI,EAAC;EAAK,CAAC;EACzBQ,CAAC,EAAW;IAAER,IAAI,EAAC;EAAK;AACzB,CAAC;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAIa,IAAA+D,uBAAU,EACzB;EACC,CAAC,EAAE9D,UAAU;EACb,CAAC,EAAEI,UAAU;EACb,CAAC,EAAE+B,UAAU;EACb,CAAC,EAAEO,UAAU;EACbqB,MAAM,EAAE,CAAC;EAAG;;EAEZC,SAAS;EAAG;EACZ;IACC,CAAC,EAAER,eAAe;IAClB,CAAC,EAAEC,eAAe;IAClB,CAAC,EAAEC,eAAe;IAClB,CAAC,EAAEC;EACJ;AACD,CAAC,CAAC;AAAAM,MAAA,CAAAJ,OAAA,GAAAA,OAAA,CAAA9D,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlChecker.js b/lib-cjs/public/HtmlChecker.js
deleted file mode 100644
index 7b456eca..00000000
--- a/lib-cjs/public/HtmlChecker.js
+++ /dev/null
@@ -1,229 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _events = require("../internal/events");
-var _Link = require("../internal/Link");
-var _linkTypes = require("link-types");
-var _parseHTML = _interopRequireDefault(require("../internal/parseHTML"));
-var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
-var _robotDirectives = _interopRequireWildcard(require("robot-directives"));
-var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
-var _scrapeHTML = _interopRequireDefault(require("../internal/scrapeHTML"));
-var _httpProtocol = require("../internal/http-protocol");
-var _UrlChecker = _interopRequireDefault(require("./UrlChecker"));
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
-function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
-function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
-function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
-function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
-function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
-function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
-function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
-function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
-var _auth = /*#__PURE__*/new WeakMap();
-var _excludedLinks = /*#__PURE__*/new WeakMap();
-var _options = /*#__PURE__*/new WeakMap();
-var _resolvePromise = /*#__PURE__*/new WeakMap();
-var _robots = /*#__PURE__*/new WeakMap();
-var _scanning = /*#__PURE__*/new WeakMap();
-var _urlChecker = /*#__PURE__*/new WeakMap();
-var _complete = /*#__PURE__*/new WeakSet();
-var _getExcludeReason = /*#__PURE__*/new WeakSet();
-var _isExcludedAttribute = /*#__PURE__*/new WeakSet();
-var _maybeEnqueueLink = /*#__PURE__*/new WeakSet();
-var _reset = /*#__PURE__*/new WeakSet();
-class HtmlChecker extends _SafeEventEmitter.default {
-  constructor(options) {
-    super();
-    _classPrivateMethodInitSpec(this, _reset);
-    /**
-     * Enqueue a Link if it is valid and passes filters.
-     * @param {Link} link
-     */
-    _classPrivateMethodInitSpec(this, _maybeEnqueueLink);
-    /**
-     * Determine whether a Link's HTML element and attribute would cause it to be excluded from checks.
-     * @param {string} attrName
-     * @param {Array} tagNames
-     * @returns {boolean}
-     */
-    _classPrivateMethodInitSpec(this, _isExcludedAttribute);
-    /**
-     * Determine whether a Link should be excluded from checks, and the reason for such.
-     * @param {Link} link
-     * @returns {string|undefined}
-     */
-    _classPrivateMethodInitSpec(this, _getExcludeReason);
-    _classPrivateMethodInitSpec(this, _complete);
-    _classPrivateFieldInitSpec(this, _auth, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _excludedLinks, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _options, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _resolvePromise, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _robots, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _scanning, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _urlChecker, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldSet(this, _options, (0, _parseOptions.default)(options));
-    _classPrivateMethodGet(this, _reset, _reset2).call(this);
-    _classPrivateFieldSet(this, _urlChecker, new _UrlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, result => {
-      var _this$excludedLinks, _this$excludedLinks2;
-      result.set(_Link.HTML_OFFSET_INDEX, (_classPrivateFieldSet(this, _excludedLinks, (_this$excludedLinks = _classPrivateFieldGet(this, _excludedLinks), _this$excludedLinks2 = _this$excludedLinks++, _this$excludedLinks)), _this$excludedLinks2));
-      this.emit(_events.JUNK_EVENT, result);
-    }).on(_events.LINK_EVENT, result => this.emit(_events.LINK_EVENT, result)).on(_events.END_EVENT, () => _classPrivateMethodGet(this, _complete, _complete2).call(this)));
-  }
-  clearCache() {
-    _classPrivateFieldGet(this, _urlChecker).clearCache();
-    return this;
-  }
-  get isPaused() {
-    return _classPrivateFieldGet(this, _urlChecker).isPaused;
-  }
-  get numActiveLinks() {
-    return _classPrivateFieldGet(this, _urlChecker).numActiveLinks;
-  }
-  get numQueuedLinks() {
-    return _classPrivateFieldGet(this, _urlChecker).numQueuedLinks;
-  }
-  pause() {
-    _classPrivateFieldGet(this, _urlChecker).pause();
-    return this;
-  }
-  resume() {
-    _classPrivateFieldGet(this, _urlChecker).resume();
-    return this;
-  }
-
-  // `robots` and `auth` are undocumented and for internal use only
-  async scan(html, baseURL, robots, auth) {
-    if (_classPrivateFieldGet(this, _scanning)) {
-      // @todo use custom error (for better tests and consumer debugging) ?
-      throw new Error("Scan already in progress");
-    } else {
-      // Prevent user error with missing undocumented arugment
-      if (!(robots instanceof _robotDirectives.default)) {
-        robots = new _robotDirectives.default({
-          userAgent: _classPrivateFieldGet(this, _options).userAgent
-        });
-      }
-      const transitive = (0, _httpProtocol.transitiveAuth)(baseURL, auth);
-      baseURL = transitive.url; // @todo remove hash (and store somewhere?)
-
-      _classPrivateFieldSet(this, _auth, transitive.auth);
-      _classPrivateFieldSet(this, _robots, robots);
-      _classPrivateFieldSet(this, _scanning, true);
-      const document = await (0, _parseHTML.default)(html);
-      const links = (0, _scrapeHTML.default)(document, baseURL, _classPrivateFieldGet(this, _robots)); // @todo add auth?
-
-      this.emit(_events.HTML_EVENT, document, _classPrivateFieldGet(this, _robots));
-      links.forEach(link => _classPrivateMethodGet(this, _maybeEnqueueLink, _maybeEnqueueLink2).call(this, link));
-      const resolveOnComplete = new Promise(resolve => _classPrivateFieldSet(this, _resolvePromise, resolve));
-
-      // If no links found or all links already checked
-      if (_classPrivateFieldGet(this, _urlChecker).numActiveLinks === 0 && _classPrivateFieldGet(this, _urlChecker).numQueuedLinks === 0) {
-        _classPrivateMethodGet(this, _complete, _complete2).call(this);
-      }
-      return resolveOnComplete;
-    }
-  }
-  get __cache() {
-    return _classPrivateFieldGet(this, _urlChecker).__cache;
-  }
-}
-
-//::: PRIVATE FUNCTIONS
-exports.default = HtmlChecker;
-function _complete2() {
-  const resolvePromise = _classPrivateFieldGet(this, _resolvePromise);
-  _classPrivateMethodGet(this, _reset, _reset2).call(this);
-  this.emit(_events.COMPLETE_EVENT);
-  resolvePromise();
-}
-function _getExcludeReason2(link) {
-  const attrName = link.get(_Link.HTML_ATTR_NAME);
-  const attrs = link.get(_Link.HTML_ATTRS);
-  const isInternal = link.get(_Link.IS_INTERNAL);
-  const tagName = link.get(_Link.HTML_TAG_NAME);
-  const {
-    excludeExternalLinks,
-    excludeInternalLinks,
-    excludeLinksToSamePage,
-    honorRobotExclusions
-  } = _classPrivateFieldGet(this, _options);
-  if (honorRobotExclusions && _classPrivateFieldGet(this, _robots).oneIs([_robotDirectives.NOFOLLOW, _robotDirectives.NOINDEX])) {
-    return "BLC_ROBOTS";
-  } else if (honorRobotExclusions && _classPrivateFieldGet(this, _robots).is(_robotDirectives.NOIMAGEINDEX) && isRobotAttr(tagName, attrName)) {
-    return "BLC_ROBOTS";
-  } else if (honorRobotExclusions && (attrs === null || attrs === void 0 ? void 0 : attrs.rel) != null && (0, _linkTypes.map)(attrs.rel).nofollow) {
-    return "BLC_ROBOTS";
-  } else if (_classPrivateMethodGet(this, _isExcludedAttribute, _isExcludedAttribute2).call(this, attrName, [tagName, "*"])) {
-    return "BLC_HTML";
-  } else if (excludeExternalLinks && isInternal === false) {
-    return "BLC_EXTERNAL";
-  } else if (excludeInternalLinks && isInternal) {
-    return "BLC_INTERNAL";
-  } else if (excludeLinksToSamePage && link.get(_Link.IS_SAME_PAGE)) {
-    return "BLC_SAMEPAGE";
-  }
-}
-function _isExcludedAttribute2(attrName, tagNames) {
-  const tagGroups = _classPrivateFieldGet(this, _options).tags[_classPrivateFieldGet(this, _options).filterLevel];
-  return tagNames.every(tagName => !(tagName in tagGroups) || !(attrName in tagGroups[tagName]));
-}
-function _maybeEnqueueLink2(link) {
-  if (link.get(_Link.REBASED_URL) === null) {
-    link.set(_Link.HTML_OFFSET_INDEX, link.get(_Link.HTML_INDEX) - _classPrivateFieldGet(this, _excludedLinks));
-    link.break("BLC_INVALID");
-
-    // Can't enqueue a non-URL
-    this.emit(_events.LINK_EVENT, link);
-  } else {
-    const excludedReason = _classPrivateMethodGet(this, _getExcludeReason, _getExcludeReason2).call(this, link);
-    if (excludedReason === undefined) {
-      link.set(_Link.HTML_OFFSET_INDEX, link.get(_Link.HTML_INDEX) - _classPrivateFieldGet(this, _excludedLinks));
-      _classPrivateFieldGet(this, _urlChecker).enqueue(link, null, _classPrivateFieldGet(this, _auth));
-    } else {
-      var _this$excludedLinks3, _this$excludedLinks4;
-      link.set(_Link.HTML_OFFSET_INDEX, (_classPrivateFieldSet(this, _excludedLinks, (_this$excludedLinks3 = _classPrivateFieldGet(this, _excludedLinks), _this$excludedLinks4 = _this$excludedLinks3++, _this$excludedLinks3)), _this$excludedLinks4));
-      link.exclude(excludedReason);
-      this.emit(_events.JUNK_EVENT, link);
-    }
-  }
-}
-function _reset2() {
-  _classPrivateFieldSet(this, _auth, null);
-  _classPrivateFieldSet(this, _excludedLinks, 0);
-  _classPrivateFieldSet(this, _resolvePromise, null);
-  _classPrivateFieldSet(this, _robots, null);
-  _classPrivateFieldSet(this, _scanning, false);
-}
-const isRobotAttr = (tagName, attrName) => {
-  return tagName === "img" && attrName === "src" || tagName === "input" && attrName === "src" || tagName === "menuitem" && attrName === "icon" || tagName === "video" && attrName === "poster";
-};
-module.exports = exports.default;
-//# sourceMappingURL=HtmlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlChecker.js.map b/lib-cjs/public/HtmlChecker.js.map
deleted file mode 100644
index 05fe1af8..00000000
--- a/lib-cjs/public/HtmlChecker.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"HtmlChecker.js","names":["_events","require","_Link","_linkTypes","_parseHTML","_interopRequireDefault","_parseOptions","_robotDirectives","_interopRequireWildcard","_SafeEventEmitter","_scrapeHTML","_httpProtocol","_UrlChecker","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateMethodGet","fn","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","_auth","_excludedLinks","_options","_resolvePromise","_robots","_scanning","_urlChecker","_complete","WeakSet","_getExcludeReason","_isExcludedAttribute","_maybeEnqueueLink","_reset","HtmlChecker","SafeEventEmitter","constructor","options","parseOptions","_reset2","UrlChecker","on","ERROR_EVENT","error","emit","QUEUE_EVENT","JUNK_EVENT","result","_this$excludedLinks","_this$excludedLinks2","HTML_OFFSET_INDEX","LINK_EVENT","END_EVENT","_complete2","clearCache","isPaused","numActiveLinks","numQueuedLinks","pause","resume","scan","html","baseURL","robots","auth","Error","RobotDirectives","userAgent","transitive","transitiveAuth","url","document","parseHTML","links","scrapeHTML","HTML_EVENT","forEach","link","_maybeEnqueueLink2","resolveOnComplete","Promise","resolve","__cache","exports","resolvePromise","COMPLETE_EVENT","_getExcludeReason2","attrName","HTML_ATTR_NAME","attrs","HTML_ATTRS","isInternal","IS_INTERNAL","tagName","HTML_TAG_NAME","excludeExternalLinks","excludeInternalLinks","excludeLinksToSamePage","honorRobotExclusions","oneIs","NOFOLLOW","NOINDEX","is","NOIMAGEINDEX","isRobotAttr","rel","linkTypes","nofollow","_isExcludedAttribute2","IS_SAME_PAGE","tagNames","tagGroups","tags","filterLevel","every","REBASED_URL","HTML_INDEX","break","excludedReason","undefined","enqueue","_this$excludedLinks3","_this$excludedLinks4","exclude","module"],"sources":["../../lib/public/HtmlChecker.js"],"sourcesContent":["import {COMPLETE_EVENT, END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport {HTML_ATTR_NAME, HTML_ATTRS, HTML_INDEX, HTML_OFFSET_INDEX, HTML_TAG_NAME, IS_INTERNAL, IS_SAME_PAGE, REBASED_URL} from \"../internal/Link\";\nimport {map as linkTypes} from \"link-types\";\nimport parseHTML from \"../internal/parseHTML\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RobotDirectives, {NOFOLLOW, NOIMAGEINDEX, NOINDEX} from \"robot-directives\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport scrapeHTML from \"../internal/scrapeHTML\";\nimport {transitiveAuth} from \"../internal/http-protocol\";\nimport UrlChecker from \"./UrlChecker\";\n\n\n\nexport default class HtmlChecker extends SafeEventEmitter\n{\n\t#auth;\n\t#excludedLinks;\n\t#options;\n\t#resolvePromise;\n\t#robots;\n\t#scanning;\n\t#urlChecker;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#options = parseOptions(options);\n\t\tthis.#reset();\n\n\t\tthis.#urlChecker = new UrlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, result =>\n\t\t{\n\t\t\tresult.set(HTML_OFFSET_INDEX, this.#excludedLinks++);\n\n\t\t\tthis.emit(JUNK_EVENT, result);\n\t\t})\n\t\t.on(LINK_EVENT, result => this.emit(LINK_EVENT, result))\n\t\t.on(END_EVENT, () => this.#complete());\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#urlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\t#complete()\n\t{\n\t\tconst resolvePromise = this.#resolvePromise;\n\n\t\tthis.#reset();\n\n\t\tthis.emit(COMPLETE_EVENT);\n\n\t\tresolvePromise();\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be excluded from checks, and the reason for such.\n\t * @param {Link} link\n\t * @returns {string|undefined}\n\t */\n\t#getExcludeReason(link)\n\t{\n\t\tconst attrName = link.get(HTML_ATTR_NAME);\n\t\tconst attrs = link.get(HTML_ATTRS);\n\t\tconst isInternal = link.get(IS_INTERNAL);\n\t\tconst tagName = link.get(HTML_TAG_NAME);\n\n\t\tconst\n\t\t{\n\t\t\texcludeExternalLinks,\n\t\t\texcludeInternalLinks,\n\t\t\texcludeLinksToSamePage,\n\t\t\thonorRobotExclusions\n\t\t} = this.#options;\n\n\t\tif (honorRobotExclusions && this.#robots.oneIs([ NOFOLLOW, NOINDEX ]))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (honorRobotExclusions && this.#robots.is(NOIMAGEINDEX) && isRobotAttr(tagName, attrName))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (honorRobotExclusions && attrs?.rel!=null && linkTypes(attrs.rel).nofollow)\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse if (this.#isExcludedAttribute(attrName, [tagName, \"*\"]))\n\t\t{\n\t\t\treturn \"BLC_HTML\";\n\t\t}\n\t\telse if (excludeExternalLinks && isInternal===false)\n\t\t{\n\t\t\treturn \"BLC_EXTERNAL\";\n\t\t}\n\t\telse if (excludeInternalLinks && isInternal)\n\t\t{\n\t\t\treturn \"BLC_INTERNAL\";\n\t\t}\n\t\telse if (excludeLinksToSamePage && link.get(IS_SAME_PAGE))\n\t\t{\n\t\t\treturn \"BLC_SAMEPAGE\";\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link's HTML element and attribute would cause it to be excluded from checks.\n\t * @param {string} attrName\n\t * @param {Array} tagNames\n\t * @returns {boolean}\n\t */\n\t#isExcludedAttribute(attrName, tagNames)\n\t{\n\t\tconst tagGroups = this.#options.tags[this.#options.filterLevel];\n\n\t\treturn tagNames.every(tagName => !(tagName in tagGroups) || !(attrName in tagGroups[tagName]));\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#urlChecker.isPaused;\n\t}\n\n\n\n\t/**\n\t * Enqueue a Link if it is valid and passes filters.\n\t * @param {Link} link\n\t */\n\t#maybeEnqueueLink(link)\n\t{\n\t\tif (link.get(REBASED_URL) === null)\n\t\t{\n\t\t\tlink.set(HTML_OFFSET_INDEX, link.get(HTML_INDEX) - this.#excludedLinks);\n\t\t\tlink.break(\"BLC_INVALID\");\n\n\t\t\t// Can't enqueue a non-URL\n\t\t\tthis.emit(LINK_EVENT, link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst excludedReason = this.#getExcludeReason(link);\n\n\t\t\tif (excludedReason === undefined)\n\t\t\t{\n\t\t\t\tlink.set(HTML_OFFSET_INDEX, link.get(HTML_INDEX) - this.#excludedLinks);\n\n\t\t\t\tthis.#urlChecker.enqueue(link, null, this.#auth);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlink.set(HTML_OFFSET_INDEX, this.#excludedLinks++);\n\t\t\t\tlink.exclude(excludedReason);\n\n\t\t\t\tthis.emit(JUNK_EVENT, link);\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#urlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#urlChecker.numQueuedLinks;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#urlChecker.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#auth = null;\n\t\tthis.#excludedLinks = 0;\n\t\tthis.#resolvePromise = null;\n\t\tthis.#robots = null;\n\t\tthis.#scanning = false;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#urlChecker.resume();\n\t\treturn this;\n\t}\n\n\n\n\t// `robots` and `auth` are undocumented and for internal use only\n\tasync scan(html, baseURL, robots, auth)\n\t{\n\t\tif (this.#scanning)\n\t\t{\n\t\t\t// @todo use custom error (for better tests and consumer debugging) ?\n\t\t\tthrow new Error(\"Scan already in progress\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Prevent user error with missing undocumented arugment\n\t\t\tif (!(robots instanceof RobotDirectives))\n\t\t\t{\n\t\t\t\trobots = new RobotDirectives({ userAgent: this.#options.userAgent });\n\t\t\t}\n\n\t\t\tconst transitive = transitiveAuth(baseURL, auth);\n\n\t\t\tbaseURL = transitive.url;  // @todo remove hash (and store somewhere?)\n\n\t\t\tthis.#auth = transitive.auth;\n\t\t\tthis.#robots = robots;\n\t\t\tthis.#scanning = true;\n\n\t\t\tconst document = await parseHTML(html);\n\t\t\tconst links = scrapeHTML(document, baseURL, this.#robots);  // @todo add auth?\n\n\t\t\tthis.emit(HTML_EVENT, document, this.#robots);\n\n\t\t\tlinks.forEach(link => this.#maybeEnqueueLink(link));\n\n\t\t\tconst resolveOnComplete = new Promise(resolve => this.#resolvePromise = resolve);\n\n\t\t\t// If no links found or all links already checked\n\t\t\tif (this.#urlChecker.numActiveLinks===0 && this.#urlChecker.numQueuedLinks===0)\n\t\t\t{\n\t\t\t\tthis.#complete();\n\t\t\t}\n\n\t\t\treturn resolveOnComplete;\n\t\t}\n\t}\n\n\n\n\tget __cache()\n\t{\n\t\treturn this.#urlChecker.__cache;\n\t}\n}\n\n\n\n//::: PRIVATE FUNCTIONS\n\n\n\nconst isRobotAttr = (tagName, attrName) =>\n{\n\treturn (tagName===\"img\"      && attrName===\"src\"   ) ||\n\t       (tagName===\"input\"    && attrName===\"src\"   ) ||\n\t       (tagName===\"menuitem\" && attrName===\"icon\"  ) ||\n\t       (tagName===\"video\"    && attrName===\"poster\");\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,gBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,WAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAP,sBAAA,CAAAJ,OAAA;AAAsC,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAA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AI,CAAC1E,IAAI,CAACE,kBAAU,EAAE+B,IAAI,CAAC;IAC5B;EACD;AACD;AAAC,SAAAtC,QAAA,EA2BD;EACCtB,qBAAA,KAAI,EAAAI,KAAA,EAAS,IAAI;EACjBJ,qBAAA,KAAI,EAAAK,cAAA,EAAkB,CAAC;EACvBL,qBAAA,KAAI,EAAAO,eAAA,EAAmB,IAAI;EAC3BP,qBAAA,KAAI,EAAAQ,OAAA,EAAW,IAAI;EACnBR,qBAAA,KAAI,EAAAS,SAAA,EAAa,KAAK;AACvB;AAqED,MAAM8E,WAAW,GAAGA,CAACX,OAAO,EAAEN,QAAQ,KACtC;EACC,OAAQM,OAAO,KAAG,KAAK,IAASN,QAAQ,KAAG,KAAK,IACxCM,OAAO,KAAG,OAAO,IAAON,QAAQ,KAAG,KAAS,IAC5CM,OAAO,KAAG,UAAU,IAAIN,QAAQ,KAAG,MAAS,IAC5CM,OAAO,KAAG,OAAO,IAAON,QAAQ,KAAG,QAAS;AACrD,CAAC;AAACqC,MAAA,CAAAzC,OAAA,GAAAA,OAAA,CAAAlG,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlUrlChecker.js b/lib-cjs/public/HtmlUrlChecker.js
deleted file mode 100644
index f3747c84..00000000
--- a/lib-cjs/public/HtmlUrlChecker.js
+++ /dev/null
@@ -1,212 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _events = require("../internal/events");
-var _HtmlChecker = _interopRequireDefault(require("./HtmlChecker"));
-var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
-var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
-var _robotDirectives = _interopRequireDefault(require("robot-directives"));
-var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
-var _streamHTML = _interopRequireDefault(require("../internal/streamHTML"));
-var _httpProtocol = require("../internal/http-protocol");
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
-function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
-function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
-function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
-function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
-function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
-function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
-function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
-function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
-var _currentAuth = /*#__PURE__*/new WeakMap();
-var _currentCustomData = /*#__PURE__*/new WeakMap();
-var _currentDone = /*#__PURE__*/new WeakMap();
-var _currentPageURL = /*#__PURE__*/new WeakMap();
-var _currentResponse = /*#__PURE__*/new WeakMap();
-var _currentRobots = /*#__PURE__*/new WeakMap();
-var _htmlChecker = /*#__PURE__*/new WeakMap();
-var _htmlUrlQueue = /*#__PURE__*/new WeakMap();
-var _options = /*#__PURE__*/new WeakMap();
-var _appendRobotHeaders = /*#__PURE__*/new WeakSet();
-var _completedPage = /*#__PURE__*/new WeakSet();
-var _reset = /*#__PURE__*/new WeakSet();
-class HtmlUrlChecker extends _SafeEventEmitter.default {
-  constructor(options) {
-    super();
-    _classPrivateMethodInitSpec(this, _reset);
-    /**
-     * Emit PAGE_EVENT and continue the queue.
-     * @param {Error} [error]
-     */
-    _classPrivateMethodInitSpec(this, _completedPage);
-    /**
-     * Append any robot headers.
-     */
-    _classPrivateMethodInitSpec(this, _appendRobotHeaders);
-    _classPrivateFieldInitSpec(this, _currentAuth, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentCustomData, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentDone, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentPageURL, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentResponse, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentRobots, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _htmlChecker, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _htmlUrlQueue, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _options, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateMethodGet(this, _reset, _reset2).call(this);
-    _classPrivateFieldSet(this, _options, (0, _parseOptions.default)(options));
-    _classPrivateFieldSet(this, _htmlUrlQueue, new _limitedRequestQueue.default({
-      maxSockets: 1,
-      rateLimit: _classPrivateFieldGet(this, _options).rateLimit
-    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
-      auth,
-      customData
-    }, done) => {
-      _classPrivateMethodGet(this, _reset, _reset2).call(this);
-      _classPrivateFieldSet(this, _currentAuth, auth);
-      _classPrivateFieldSet(this, _currentCustomData, customData);
-      _classPrivateFieldSet(this, _currentDone, done);
-      _classPrivateFieldSet(this, _currentPageURL, url); // @todo remove hash ?
-
-      try {
-        const {
-          response,
-          stream
-        } = await (0, _streamHTML.default)(_classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentAuth), this.__cache, _classPrivateFieldGet(this, _options));
-
-        // Is only defined for HTTP -- made null for consistency
-        _classPrivateFieldSet(this, _currentResponse, response ?? null);
-        _classPrivateFieldSet(this, _currentRobots, new _robotDirectives.default({
-          userAgent: _classPrivateFieldGet(this, _options).userAgent
-        }));
-        _classPrivateMethodGet(this, _appendRobotHeaders, _appendRobotHeaders2).call(this);
-
-        // If redirected for HTTP, or original URL for non-HTTP
-        const finalPageURL = (response === null || response === void 0 ? void 0 : response.url) ?? _classPrivateFieldGet(this, _currentPageURL);
-
-        // Passes robots instance so that headers are included in robot exclusion checks
-        // @todo does the `await` cause `completedPage` to be called twice (other's in COMPLETE_EVENT) if error occurs?
-        await _classPrivateFieldGet(this, _htmlChecker).scan(stream, finalPageURL, _classPrivateFieldGet(this, _currentRobots), _classPrivateFieldGet(this, _currentAuth));
-      } catch (error) {
-        _classPrivateMethodGet(this, _completedPage, _completedPage2).call(this, error);
-      }
-    }).on(_limitedRequestQueue.END_EVENT, () => {
-      // Clear references for garbage collection
-      _classPrivateMethodGet(this, _reset, _reset2).call(this);
-      this.emit(_events.END_EVENT);
-    }));
-    _classPrivateFieldSet(this, _htmlChecker, new _HtmlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.HTML_EVENT, (tree, robots) => {
-      this.emit(_events.HTML_EVENT, tree, robots, _classPrivateFieldGet(this, _currentResponse), _classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentCustomData));
-    }).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, result => this.emit(_events.JUNK_EVENT, result, _classPrivateFieldGet(this, _currentCustomData))).on(_events.LINK_EVENT, result => this.emit(_events.LINK_EVENT, result, _classPrivateFieldGet(this, _currentCustomData))).on(_events.COMPLETE_EVENT, () => _classPrivateMethodGet(this, _completedPage, _completedPage2).call(this)));
-  }
-  clearCache() {
-    _classPrivateFieldGet(this, _htmlChecker).clearCache();
-    return this;
-  }
-  dequeue(id) {
-    const success = _classPrivateFieldGet(this, _htmlUrlQueue).dequeue(id);
-    this.emit(_events.QUEUE_EVENT);
-    return success;
-  }
-
-  // `auth` is undocumented and for internal use only
-  enqueue(pageURL, customData, auth) {
-    // @todo this could get messy if there're many different credentials per site (if we cache based on headers)
-    const transitive = (0, _httpProtocol.transitiveAuth)(pageURL, auth);
-    const id = _classPrivateFieldGet(this, _htmlUrlQueue).enqueue(transitive.url, {
-      auth: transitive.auth,
-      customData
-    });
-    this.emit(_events.QUEUE_EVENT);
-    return id;
-  }
-  has(id) {
-    return _classPrivateFieldGet(this, _htmlUrlQueue).has(id);
-  }
-  get isPaused() {
-    return _classPrivateFieldGet(this, _htmlChecker).isPaused;
-  }
-  get numActiveLinks() {
-    return _classPrivateFieldGet(this, _htmlChecker).numActiveLinks;
-  }
-  get numPages() {
-    return _classPrivateFieldGet(this, _htmlUrlQueue).length;
-  }
-  get numQueuedLinks() {
-    return _classPrivateFieldGet(this, _htmlChecker).numQueuedLinks;
-  }
-  pause() {
-    _classPrivateFieldGet(this, _htmlChecker).pause();
-    _classPrivateFieldGet(this, _htmlUrlQueue).pause();
-    return this;
-  }
-  resume() {
-    _classPrivateFieldGet(this, _htmlChecker).resume();
-    _classPrivateFieldGet(this, _htmlUrlQueue).resume();
-    return this;
-  }
-  get __cache() {
-    return _classPrivateFieldGet(this, _htmlChecker).__cache;
-  }
-}
-exports.default = HtmlUrlChecker;
-function _appendRobotHeaders2() {
-  var _classPrivateFieldGet2;
-  const xRobotsTag = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _currentResponse)) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.headers["x-robots-tag"];
-
-  // @todo https://github.com/nodejs/node/issues/3591
-  if (xRobotsTag != null) {
-    _classPrivateFieldGet(this, _currentRobots).header(xRobotsTag);
-  }
-}
-function _completedPage2(error = null) {
-  // @todo emit page error instead?
-  // @todo include redirected url if there is one?
-  this.emit(_events.PAGE_EVENT, error, _classPrivateFieldGet(this, _currentPageURL), _classPrivateFieldGet(this, _currentCustomData));
-
-  // Auto-starts next queue item, if any
-  // Emits REQUEST_QUEUE_END_EVENT, if not
-  _classPrivateFieldGet(this, _currentDone).call(this);
-}
-function _reset2() {
-  _classPrivateFieldSet(this, _currentAuth, null);
-  _classPrivateFieldSet(this, _currentCustomData, null);
-  _classPrivateFieldSet(this, _currentDone, null);
-  _classPrivateFieldSet(this, _currentPageURL, null);
-  _classPrivateFieldSet(this, _currentResponse, null);
-  _classPrivateFieldSet(this, _currentRobots, null);
-}
-module.exports = exports.default;
-//# sourceMappingURL=HtmlUrlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/HtmlUrlChecker.js.map b/lib-cjs/public/HtmlUrlChecker.js.map
deleted file mode 100644
index f497cab6..00000000
--- a/lib-cjs/public/HtmlUrlChecker.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"HtmlUrlChecker.js","names":["_events","require","_HtmlChecker","_interopRequireDefault","_parseOptions","_limitedRequestQueue","_interopRequireWildcard","_robotDirectives","_SafeEventEmitter","_streamHTML","_httpProtocol","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","_classPrivateMethodGet","fn","_currentAuth","_currentCustomData","_currentDone","_currentPageURL","_currentResponse","_currentRobots","_htmlChecker","_htmlUrlQueue","_options","_appendRobotHeaders","WeakSet","_completedPage","_reset","HtmlUrlChecker","SafeEventEmitter","constructor","options","_reset2","parseOptions","RequestQueue","maxSockets","rateLimit","on","ITEM_EVENT","url","auth","customData","done","response","stream","streamHTML","__cache","RobotDirectives","userAgent","_appendRobotHeaders2","finalPageURL","scan","error","_completedPage2","REQUEST_QUEUE_END_EVENT","emit","END_EVENT","HtmlChecker","ERROR_EVENT","HTML_EVENT","tree","robots","QUEUE_EVENT","JUNK_EVENT","result","LINK_EVENT","COMPLETE_EVENT","clearCache","dequeue","id","success","enqueue","pageURL","transitive","transitiveAuth","isPaused","numActiveLinks","numPages","length","numQueuedLinks","pause","resume","exports","_classPrivateFieldGet2","xRobotsTag","headers","header","PAGE_EVENT","module"],"sources":["../../lib/public/HtmlUrlChecker.js"],"sourcesContent":["import {COMPLETE_EVENT, END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport HtmlChecker from \"./HtmlChecker\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport RobotDirectives from \"robot-directives\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport streamHTML from \"../internal/streamHTML\";\nimport {transitiveAuth} from \"../internal/http-protocol\";\n\n\n\nexport default class HtmlUrlChecker extends SafeEventEmitter\n{\n\t#currentAuth;\n\t#currentCustomData;\n\t#currentDone;\n\t#currentPageURL;\n\t#currentResponse;\n\t#currentRobots;\n\t#htmlChecker;\n\t#htmlUrlQueue;\n\t#options;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#reset();\n\n\t\tthis.#options = parseOptions(options);\n\n\t\tthis.#htmlUrlQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets: 1,\n\t\t\trateLimit: this.#options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData}, done) =>\n\t\t{\n\t\t\tthis.#reset();\n\n\t\t\tthis.#currentAuth = auth;\n\t\t\tthis.#currentCustomData = customData;\n\t\t\tthis.#currentDone = done;\n\t\t\tthis.#currentPageURL = url;  // @todo remove hash ?\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst {response, stream} = await streamHTML(this.#currentPageURL, this.#currentAuth, this.__cache, this.#options);\n\n\t\t\t\t// Is only defined for HTTP -- made null for consistency\n\t\t\t\tthis.#currentResponse = response ?? null;\n\n\t\t\t\tthis.#currentRobots = new RobotDirectives({ userAgent: this.#options.userAgent });\n\n\t\t\t\tthis.#appendRobotHeaders();\n\n\t\t\t\t// If redirected for HTTP, or original URL for non-HTTP\n\t\t\t\tconst finalPageURL = response?.url ?? this.#currentPageURL;\n\n\t\t\t\t// Passes robots instance so that headers are included in robot exclusion checks\n\t\t\t\t// @todo does the `await` cause `completedPage` to be called twice (other's in COMPLETE_EVENT) if error occurs?\n\t\t\t\tawait this.#htmlChecker.scan(stream, finalPageURL, this.#currentRobots, this.#currentAuth);\n\t\t\t}\n\t\t\tcatch (error)\n\t\t\t{\n\t\t\t\tthis.#completedPage(error);\n\t\t\t}\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () =>\n\t\t{\n\t\t\t// Clear references for garbage collection\n\t\t\tthis.#reset();\n\n\t\t\tthis.emit(END_EVENT);\n\t\t});\n\n\t\tthis.#htmlChecker = new HtmlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(HTML_EVENT, (tree, robots) =>\n\t\t{\n\t\t\tthis.emit(HTML_EVENT, tree, robots, this.#currentResponse, this.#currentPageURL, this.#currentCustomData);\n\t\t})\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, result => this.emit(JUNK_EVENT, result, this.#currentCustomData))\n\t\t.on(LINK_EVENT, result => this.emit(LINK_EVENT, result, this.#currentCustomData))\n\t\t.on(COMPLETE_EVENT, () => this.#completedPage());\n\t}\n\n\n\n\t/**\n\t * Append any robot headers.\n\t */\n\t#appendRobotHeaders()\n\t{\n\t\tconst xRobotsTag = this.#currentResponse?.headers[\"x-robots-tag\"];\n\n\t\t// @todo https://github.com/nodejs/node/issues/3591\n\t\tif (xRobotsTag != null)\n\t\t{\n\t\t\tthis.#currentRobots.header(xRobotsTag);\n\t\t}\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#htmlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\t/**\n\t * Emit PAGE_EVENT and continue the queue.\n\t * @param {Error} [error]\n\t */\n\t#completedPage(error = null)\n\t{\n\t\t// @todo emit page error instead?\n\t\t// @todo include redirected url if there is one?\n\t\tthis.emit(PAGE_EVENT, error, this.#currentPageURL, this.#currentCustomData);\n\n\t\t// Auto-starts next queue item, if any\n\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\tthis.#currentDone();\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#htmlUrlQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t// `auth` is undocumented and for internal use only\n\tenqueue(pageURL, customData, auth)\n\t{\n\t\t// @todo this could get messy if there're many different credentials per site (if we cache based on headers)\n\t\tconst transitive = transitiveAuth(pageURL, auth);\n\n\t\tconst id = this.#htmlUrlQueue.enqueue(transitive.url, { auth:transitive.auth, customData });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn id;\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#htmlUrlQueue.has(id);\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#htmlChecker.isPaused;\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#htmlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numPages()\n\t{\n\t\treturn this.#htmlUrlQueue.length;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#htmlChecker.numQueuedLinks;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#htmlChecker.pause();\n\t\tthis.#htmlUrlQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#currentAuth = null;\n\t\tthis.#currentCustomData = null;\n\t\tthis.#currentDone = null;\n\t\tthis.#currentPageURL = null;\n\t\tthis.#currentResponse = null;\n\t\tthis.#currentRobots = null;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#htmlChecker.resume();\n\t\tthis.#htmlUrlQueue.resume();\n\t\treturn this;\n\t}\n\n\n\n\tget __cache()\n\t{\n\t\treturn this.#htmlChecker.__cache;\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,iBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAAyD,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OA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;AAAC,SAAA/B,gBAgBcD,KAAK,GAAG,IAAI,EAC3B;EACC;EACA;EACA,IAAI,CAACG,IAAI,CAACgC,kBAAU,EAAEnC,KAAK,EAAAhD,qBAAA,CAAE,IAAI,EAAAc,eAAA,GAAAd,qBAAA,CAAkB,IAAI,EAAAY,kBAAA,CAAmB,CAAC;;EAE3E;EACA;EACAZ,qBAAA,KAAI,EAAAa,YAAA,EAAA1B,IAAA,CAAJ,IAAI;AACL;AAAC,SAAAyC,QAAA,EA2ED;EACCvB,qBAAA,KAAI,EAAAM,YAAA,EAAgB,IAAI;EACxBN,qBAAA,KAAI,EAAAO,kBAAA,EAAsB,IAAI;EAC9BP,qBAAA,KAAI,EAAAQ,YAAA,EAAgB,IAAI;EACxBR,qBAAA,KAAI,EAAAS,eAAA,EAAmB,IAAI;EAC3BT,qBAAA,KAAI,EAAAU,gBAAA,EAAoB,IAAI;EAC5BV,qBAAA,KAAI,EAAAW,cAAA,EAAkB,IAAI;AAC3B;AAACoE,MAAA,CAAAN,OAAA,GAAAA,OAAA,CAAAvG,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/SiteChecker.js b/lib-cjs/public/SiteChecker.js
deleted file mode 100644
index 65cb45e1..00000000
--- a/lib-cjs/public/SiteChecker.js
+++ /dev/null
@@ -1,319 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _events = require("../internal/events");
-var _Link = require("../internal/Link");
-var _httpProtocol = require("../internal/http-protocol");
-var _HtmlUrlChecker = _interopRequireDefault(require("./HtmlUrlChecker"));
-var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
-var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
-var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
-var _urlcache = _interopRequireDefault(require("urlcache"));
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
-function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
-function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
-function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
-function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
-function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
-function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
-function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
-function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
-// @todo BLC_ROBOTS catches rel=nofollow links but will also catch meta/header excluded links -- fine?
-const PAGE_EXCLUSIONS = ["BLC_KEYWORD", "BLC_ROBOTS"];
-const PAGE_WAS_CHECKED = true;
-var _currentAuth = /*#__PURE__*/new WeakMap();
-var _currentCustomData = /*#__PURE__*/new WeakMap();
-var _currentDone = /*#__PURE__*/new WeakMap();
-var _currentPageError = /*#__PURE__*/new WeakMap();
-var _currentRobotsTxt = /*#__PURE__*/new WeakMap();
-var _currentSiteURL = /*#__PURE__*/new WeakMap();
-var _htmlUrlChecker = /*#__PURE__*/new WeakMap();
-var _options = /*#__PURE__*/new WeakMap();
-var _sitePagesChecked = /*#__PURE__*/new WeakMap();
-var _siteUrlQueue = /*#__PURE__*/new WeakMap();
-var _enqueuePage = /*#__PURE__*/new WeakSet();
-var _getExcludedReason = /*#__PURE__*/new WeakSet();
-var _isAllowed = /*#__PURE__*/new WeakSet();
-var _maybeEnqueuePage = /*#__PURE__*/new WeakSet();
-var _overrideOptions = /*#__PURE__*/new WeakSet();
-var _reset = /*#__PURE__*/new WeakSet();
-class SiteChecker extends _SafeEventEmitter.default {
-  constructor(_options2) {
-    super();
-    _classPrivateMethodInitSpec(this, _reset);
-    /**
-     * Override/mutate some options for extended behavior.
-     * @param {object} options
-     * @returns {object}
-     */
-    _classPrivateMethodInitSpec(this, _overrideOptions);
-    /**
-     * Enqueue a page (to be crawled) if it passes filters.
-     * @param {Link} link
-     * @param {*} customData
-     * @param {object} auth
-     */
-    _classPrivateMethodInitSpec(this, _maybeEnqueuePage);
-    /**
-     * Determine whether a Link should be included, conforming to any robots filter.
-     * @param {Link} link
-     * @returns {boolean}
-     */
-    _classPrivateMethodInitSpec(this, _isAllowed);
-    /**
-     * Determine whether a Link should be excluded from checks, and the reason for such.
-     * @param {Link} link
-     * @returns {string|undefined}
-     */
-    _classPrivateMethodInitSpec(this, _getExcludedReason);
-    /**
-     * Enqueue a URL to be crawled.
-     * @param {URL} url
-     * @param {*} customData
-     * @param {object} auth
-     */
-    _classPrivateMethodInitSpec(this, _enqueuePage);
-    _classPrivateFieldInitSpec(this, _currentAuth, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentCustomData, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentDone, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentPageError, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentRobotsTxt, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _currentSiteURL, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _htmlUrlChecker, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _options, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _sitePagesChecked, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldInitSpec(this, _siteUrlQueue, {
-      writable: true,
-      value: void 0
-    });
-    _classPrivateFieldSet(this, _options, _classPrivateMethodGet(this, _overrideOptions, _overrideOptions2).call(this, (0, _parseOptions.default)(_options2))); // @todo https://github.com/tc39/proposal-pipeline-operator
-    _classPrivateFieldSet(this, _sitePagesChecked, new _urlcache.default({
-      maxAge: _classPrivateFieldGet(this, _options).cacheMaxAge
-    }));
-    _classPrivateMethodGet(this, _reset, _reset2).call(this);
-    _classPrivateFieldSet(this, _siteUrlQueue, new _limitedRequestQueue.default({
-      maxSockets: 1,
-      rateLimit: _classPrivateFieldGet(this, _options).rateLimit
-    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
-      auth,
-      customData
-    }, done) => {
-      _classPrivateMethodGet(this, _reset, _reset2).call(this);
-      _classPrivateFieldSet(this, _currentAuth, auth);
-      _classPrivateFieldSet(this, _currentCustomData, customData);
-      _classPrivateFieldSet(this, _currentDone, done);
-      _classPrivateFieldSet(this, _currentSiteURL, url); // @todo strip after hostname?
-
-      try {
-        if ((0, _httpProtocol.isCompatibleScheme)(url) && _classPrivateFieldGet(this, _options).honorRobotExclusions) {
-          const robots = await (0, _httpProtocol.getRobotsTxt)(_classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentAuth), this.__cache, _classPrivateFieldGet(this, _options));
-
-          // This receives an instance even if no robots.txt was found
-          _classPrivateFieldSet(this, _currentRobotsTxt, robots);
-          this.emit(_events.ROBOTS_EVENT, robots, _classPrivateFieldGet(this, _currentCustomData));
-        }
-      } catch {
-        // If could not connect to server -- let `HtmlUrlChecker` catch it
-      } finally {
-        _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, _classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentCustomData), _classPrivateFieldGet(this, _currentAuth));
-      }
-    }).on(_limitedRequestQueue.END_EVENT, () => {
-      // Clear references for garbage collection
-      _classPrivateMethodGet(this, _reset, _reset2).call(this);
-      this.emit(_events.END_EVENT);
-    }));
-    _classPrivateFieldSet(this, _htmlUrlChecker, new _HtmlUrlChecker.default(_classPrivateFieldGet(this, _options)).on(_events.ERROR_EVENT, error => this.emit(_events.ERROR_EVENT, error)).on(_events.HTML_EVENT, (tree, robots, response, pageURL, customData) => {
-      // If was redirected
-      if (response.url !== pageURL) {
-        _classPrivateFieldGet(this, _sitePagesChecked).set(response.url, PAGE_WAS_CHECKED);
-
-        // Avoid rechecking any redirected pages
-        response.redirects.forEach(redirect => _classPrivateFieldGet(this, _sitePagesChecked).set(redirect.url, PAGE_WAS_CHECKED));
-      }
-      this.emit(_events.HTML_EVENT, tree, robots, response, pageURL, customData);
-    }).on(_events.QUEUE_EVENT, () => this.emit(_events.QUEUE_EVENT)).on(_events.JUNK_EVENT, (result, customData) => {
-      this.emit(_events.JUNK_EVENT, result, customData);
-      _classPrivateMethodGet(this, _maybeEnqueuePage, _maybeEnqueuePage2).call(this, result, customData, _classPrivateFieldGet(this, _currentAuth));
-    }).on(_events.LINK_EVENT, (result, customData) => {
-      this.emit(_events.LINK_EVENT, result, customData);
-      _classPrivateMethodGet(this, _maybeEnqueuePage, _maybeEnqueuePage2).call(this, result, customData, _classPrivateFieldGet(this, _currentAuth));
-    }).on(_events.PAGE_EVENT, (error, pageURL, customData) => {
-      this.emit(_events.PAGE_EVENT, error, pageURL, customData);
-
-      // Only the first page should supply an error to SITE_EVENT
-      if (_classPrivateFieldGet(this, _sitePagesChecked).length <= 1) {
-        _classPrivateFieldSet(this, _currentPageError, error);
-      }
-    }).on(_events.END_EVENT, () => {
-      this.emit(_events.SITE_EVENT, _classPrivateFieldGet(this, _currentPageError), _classPrivateFieldGet(this, _currentSiteURL), _classPrivateFieldGet(this, _currentCustomData));
-
-      // Auto-starts next site, if any
-      // Emits REQUEST_QUEUE_END_EVENT, if not
-      _classPrivateFieldGet(this, _currentDone).call(this);
-    }));
-  }
-  clearCache() {
-    // Does not clear `sitePagesChecked` because it would mess up any current scans
-    _classPrivateFieldGet(this, _htmlUrlChecker).clearCache();
-    return this;
-  }
-  dequeue(id) {
-    const success = _classPrivateFieldGet(this, _siteUrlQueue).dequeue(id);
-    this.emit(_events.QUEUE_EVENT);
-    return success;
-  }
-  enqueue(firstPageURL, customData) {
-    const transitive = (0, _httpProtocol.transitiveAuth)(firstPageURL);
-    const success = _classPrivateFieldGet(this, _siteUrlQueue).enqueue(transitive.url, {
-      auth: transitive.auth,
-      customData
-    });
-    this.emit(_events.QUEUE_EVENT);
-    return success;
-  }
-  has(id) {
-    return _classPrivateFieldGet(this, _siteUrlQueue).has(id);
-  }
-  get isPaused() {
-    return _classPrivateFieldGet(this, _htmlUrlChecker).isPaused;
-  }
-  get numActiveLinks() {
-    return _classPrivateFieldGet(this, _htmlUrlChecker).numActiveLinks;
-  }
-  get numQueuedLinks() {
-    return _classPrivateFieldGet(this, _htmlUrlChecker).numQueuedLinks;
-  }
-  get numPages() {
-    return _classPrivateFieldGet(this, _htmlUrlChecker).numPages;
-  }
-  get numSites() {
-    return _classPrivateFieldGet(this, _siteUrlQueue).length;
-  }
-  pause() {
-    _classPrivateFieldGet(this, _htmlUrlChecker).pause();
-    _classPrivateFieldGet(this, _siteUrlQueue).pause();
-    return this;
-  }
-  resume() {
-    _classPrivateFieldGet(this, _htmlUrlChecker).resume();
-    _classPrivateFieldGet(this, _siteUrlQueue).resume();
-    return this;
-  }
-
-  // Useless, but consistent with other classes
-  get __cache() {
-    return _classPrivateFieldGet(this, _htmlUrlChecker).__cache;
-  }
-}
-exports.default = SiteChecker;
-function _enqueuePage2(url, customData, auth) {
-  // Avoid links to self within page
-  _classPrivateFieldGet(this, _sitePagesChecked).set(url, PAGE_WAS_CHECKED);
-  _classPrivateFieldGet(this, _htmlUrlChecker).enqueue(url, customData, auth);
-}
-function _getExcludedReason2(link) {
-  if (link.get(_Link.IS_INTERNAL) && !_classPrivateMethodGet(this, _isAllowed, _isAllowed2).call(this, link)) {
-    return "BLC_ROBOTS";
-  } else {
-    // Not excluded
-  }
-}
-function _isAllowed2(link) {
-  if (_classPrivateFieldGet(this, _options).honorRobotExclusions) {
-    var _link$get;
-    const rebasedPathname = (_link$get = link.get(_Link.REBASED_URL)) === null || _link$get === void 0 ? void 0 : _link$get.pathname;
-
-    // @todo remove condition when/if `Link::invalidate()` is used in `HtmlChecker`
-    if (rebasedPathname !== null) {
-      return _classPrivateFieldGet(this, _currentRobotsTxt).isAllowed(_classPrivateFieldGet(this, _options).userAgent, rebasedPathname);
-    } else {
-      return true;
-    }
-  } else {
-    return true;
-  }
-}
-function _maybeEnqueuePage2(link, customData, auth) {
-  // Skip specific links that were excluded from checks
-  if (link.get(_Link.WAS_EXCLUDED) && PAGE_EXCLUSIONS.includes(link.get(_Link.EXCLUDED_REASON))) {
-    // do nothing
-  } else {
-    const tagGroup = _classPrivateFieldGet(this, _options).tags.recursive[_classPrivateFieldGet(this, _options).filterLevel][link.get(_Link.HTML_TAG_NAME)] ?? {};
-    const attrSupported = (link.get(_Link.HTML_ATTR_NAME) in tagGroup);
-    const rebasedURL = link.get(_Link.REBASED_URL);
-    const redirectedURL = link.get(_Link.REDIRECTED_URL);
-    if (!attrSupported || link.get(_Link.IS_BROKEN) || !link.get(_Link.IS_INTERNAL) || _classPrivateFieldGet(this, _sitePagesChecked).has(rebasedURL) || !_classPrivateMethodGet(this, _isAllowed, _isAllowed2).call(this, link)) {
-      // do nothing
-    } else if (redirectedURL !== null) {
-      // Because only the final redirected page needs to be [recursively] checked,
-      // all redirects are stored as pages that have been checked
-      link.get(_Link.HTTP_RESPONSE).redirects.forEach(({
-        url
-      }) => _classPrivateFieldGet(this, _sitePagesChecked).set(url, PAGE_WAS_CHECKED));
-      if (!_classPrivateFieldGet(this, _sitePagesChecked).has(redirectedURL)) {
-        _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, redirectedURL, customData, auth);
-      }
-    } else if (_classPrivateFieldGet(this, _options).includePage(rebasedURL)) {
-      _classPrivateMethodGet(this, _enqueuePage, _enqueuePage2).call(this, rebasedURL, customData, auth);
-    }
-  }
-}
-function _overrideOptions2(options) {
-  const {
-    includeLink
-  } = options;
-  options.includeLink = link => {
-    const excludedReason = _classPrivateMethodGet(this, _getExcludedReason, _getExcludedReason2).call(this, link);
-    if (excludedReason === undefined) {
-      return includeLink(link);
-    } else {
-      // Undocumented return value type
-      return excludedReason;
-    }
-  };
-  return options;
-}
-function _reset2() {
-  _classPrivateFieldSet(this, _currentAuth, null);
-  _classPrivateFieldSet(this, _currentCustomData, null);
-  _classPrivateFieldSet(this, _currentDone, null);
-  _classPrivateFieldSet(this, _currentPageError, null);
-  _classPrivateFieldSet(this, _currentRobotsTxt, null);
-  _classPrivateFieldSet(this, _currentSiteURL, null);
-  _classPrivateFieldGet(this, _sitePagesChecked).clear();
-}
-module.exports = exports.default;
-//# sourceMappingURL=SiteChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/SiteChecker.js.map b/lib-cjs/public/SiteChecker.js.map
deleted file mode 100644
index c8d3ea78..00000000
--- a/lib-cjs/public/SiteChecker.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"SiteChecker.js","names":["_events","require","_Link","_httpProtocol","_HtmlUrlChecker","_interopRequireDefault","_parseOptions","_limitedRequestQueue","_interopRequireWildcard","_SafeEventEmitter","_urlcache","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_classPrivateMethodInitSpec","privateSet","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","privateMap","value","privateCollection","TypeError","_classPrivateFieldGet","receiver","descriptor","_classExtractFieldDescriptor","_classApplyDescriptorGet","_classPrivateMethodGet","fn","_classPrivateFieldSet","_classApplyDescriptorSet","action","writable","PAGE_EXCLUSIONS","PAGE_WAS_CHECKED","_currentAuth","_currentCustomData","_currentDone","_currentPageError","_currentRobotsTxt","_currentSiteURL","_htmlUrlChecker","_options","_sitePagesChecked","_siteUrlQueue","_enqueuePage","WeakSet","_getExcludedReason","_isAllowed","_maybeEnqueuePage","_overrideOptions","_reset","SiteChecker","SafeEventEmitter","constructor","options","_overrideOptions2","parseOptions","URLCache","maxAge","cacheMaxAge","_reset2","RequestQueue","maxSockets","rateLimit","on","ITEM_EVENT","url","auth","customData","done","isHTTPScheme","honorRobotExclusions","robots","getRobotsTxt","__cache","emit","ROBOTS_EVENT","_enqueuePage2","REQUEST_QUEUE_END_EVENT","END_EVENT","HtmlUrlChecker","ERROR_EVENT","error","HTML_EVENT","tree","response","pageURL","redirects","forEach","redirect","QUEUE_EVENT","JUNK_EVENT","result","_maybeEnqueuePage2","LINK_EVENT","PAGE_EVENT","length","SITE_EVENT","clearCache","dequeue","id","success","enqueue","firstPageURL","transitive","transitiveAuth","isPaused","numActiveLinks","numQueuedLinks","numPages","numSites","pause","resume","exports","_getExcludedReason2","link","IS_INTERNAL","_isAllowed2","_link$get","rebasedPathname","REBASED_URL","pathname","isAllowed","userAgent","WAS_EXCLUDED","includes","EXCLUDED_REASON","tagGroup","tags","recursive","filterLevel","HTML_TAG_NAME","attrSupported","HTML_ATTR_NAME","rebasedURL","redirectedURL","REDIRECTED_URL","IS_BROKEN","HTTP_RESPONSE","includePage","includeLink","excludedReason","undefined","clear","module"],"sources":["../../lib/public/SiteChecker.js"],"sourcesContent":["import {END_EVENT, ERROR_EVENT, HTML_EVENT, JUNK_EVENT, LINK_EVENT, PAGE_EVENT, QUEUE_EVENT, ROBOTS_EVENT, SITE_EVENT} from \"../internal/events\";\nimport {EXCLUDED_REASON, HTML_ATTR_NAME, HTML_TAG_NAME, HTTP_RESPONSE, IS_BROKEN, IS_INTERNAL, REBASED_URL, REDIRECTED_URL, WAS_EXCLUDED} from \"../internal/Link\";\nimport {getRobotsTxt, isCompatibleScheme as isHTTPScheme, transitiveAuth} from \"../internal/http-protocol\";\nimport HtmlUrlChecker from \"./HtmlUrlChecker\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport URLCache from \"urlcache\";\n\n\n\n// @todo BLC_ROBOTS catches rel=nofollow links but will also catch meta/header excluded links -- fine?\nconst PAGE_EXCLUSIONS = [\"BLC_KEYWORD\", \"BLC_ROBOTS\"];\n\nconst PAGE_WAS_CHECKED = true;\n\n\n\nexport default class SiteChecker extends SafeEventEmitter\n{\n\t#currentAuth;\n\t#currentCustomData;\n\t#currentDone;\n\t#currentPageError;\n\t#currentRobotsTxt;\n\t#currentSiteURL;\n\t#htmlUrlChecker;\n\t#options;\n\t#sitePagesChecked;\n\t#siteUrlQueue;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\t\tthis.#options = this.#overrideOptions(parseOptions(options)); // @todo https://github.com/tc39/proposal-pipeline-operator\n\t\tthis.#sitePagesChecked = new URLCache({ maxAge: this.#options.cacheMaxAge });\n\t\tthis.#reset();\n\n\t\tthis.#siteUrlQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets: 1,\n\t\t\trateLimit: this.#options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData}, done) =>\n\t\t{\n\t\t\tthis.#reset();\n\n\t\t\tthis.#currentAuth = auth;\n\t\t\tthis.#currentCustomData = customData;\n\t\t\tthis.#currentDone = done;\n\t\t\tthis.#currentSiteURL = url;  // @todo strip after hostname?\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (isHTTPScheme(url) && this.#options.honorRobotExclusions)\n\t\t\t\t{\n\t\t\t\t\tconst robots = await getRobotsTxt(this.#currentSiteURL, this.#currentAuth, this.__cache, this.#options);\n\n\t\t\t\t\t// This receives an instance even if no robots.txt was found\n\t\t\t\t\tthis.#currentRobotsTxt = robots;\n\n\t\t\t\t\tthis.emit(ROBOTS_EVENT, robots, this.#currentCustomData);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\t// If could not connect to server -- let `HtmlUrlChecker` catch it\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tthis.#enqueuePage(this.#currentSiteURL, this.#currentCustomData, this.#currentAuth);\n\t\t\t}\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () =>\n\t\t{\n\t\t\t// Clear references for garbage collection\n\t\t\tthis.#reset();\n\n\t\t\tthis.emit(END_EVENT);\n\t\t});\n\n\t\tthis.#htmlUrlChecker = new HtmlUrlChecker(this.#options)\n\t\t.on(ERROR_EVENT, error => this.emit(ERROR_EVENT, error))\n\t\t.on(HTML_EVENT, (tree, robots, response, pageURL, customData) =>\n\t\t{\n\t\t\t// If was redirected\n\t\t\tif (response.url !== pageURL)\n\t\t\t{\n\t\t\t\tthis.#sitePagesChecked.set(response.url, PAGE_WAS_CHECKED);\n\n\t\t\t\t// Avoid rechecking any redirected pages\n\t\t\t\tresponse.redirects.forEach(redirect => this.#sitePagesChecked.set(redirect.url, PAGE_WAS_CHECKED));\n\t\t\t}\n\n\t\t\tthis.emit(HTML_EVENT, tree, robots, response, pageURL, customData);\n\t\t})\n\t\t.on(QUEUE_EVENT, () => this.emit(QUEUE_EVENT))\n\t\t.on(JUNK_EVENT, (result, customData) =>\n\t\t{\n\t\t\tthis.emit(JUNK_EVENT, result, customData);\n\n\t\t\tthis.#maybeEnqueuePage(result, customData, this.#currentAuth);\n\t\t})\n\t\t.on(LINK_EVENT, (result, customData) =>\n\t\t{\n\t\t\tthis.emit(LINK_EVENT, result, customData);\n\n\t\t\tthis.#maybeEnqueuePage(result, customData, this.#currentAuth);\n\t\t})\n\t\t.on(PAGE_EVENT, (error, pageURL, customData) =>\n\t\t{\n\t\t\tthis.emit(PAGE_EVENT, error, pageURL, customData);\n\n\t\t\t// Only the first page should supply an error to SITE_EVENT\n\t\t\tif (this.#sitePagesChecked.length <= 1)\n\t\t\t{\n\t\t\t\tthis.#currentPageError = error;\n\t\t\t}\n\t\t})\n\t\t.on(END_EVENT, () =>\n\t\t{\n\t\t\tthis.emit(SITE_EVENT, this.#currentPageError, this.#currentSiteURL, this.#currentCustomData);\n\n\t\t\t// Auto-starts next site, if any\n\t\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\t\tthis.#currentDone();\n\t\t});\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\t// Does not clear `sitePagesChecked` because it would mess up any current scans\n\t\tthis.#htmlUrlChecker.clearCache();\n\t\treturn this;\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#siteUrlQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\tenqueue(firstPageURL, customData)\n\t{\n\t\tconst transitive = transitiveAuth(firstPageURL);\n\n\t\tconst success = this.#siteUrlQueue.enqueue(transitive.url, { auth:transitive.auth, customData });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t/**\n\t * Enqueue a URL to be crawled.\n\t * @param {URL} url\n\t * @param {*} customData\n\t * @param {object} auth\n\t */\n\t#enqueuePage(url, customData, auth)\n\t{\n\t\t// Avoid links to self within page\n\t\tthis.#sitePagesChecked.set(url, PAGE_WAS_CHECKED);\n\n\t\tthis.#htmlUrlChecker.enqueue(url, customData, auth);\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be excluded from checks, and the reason for such.\n\t * @param {Link} link\n\t * @returns {string|undefined}\n\t */\n\t#getExcludedReason(link)\n\t{\n\t\tif (link.get(IS_INTERNAL) && !this.#isAllowed(link))\n\t\t{\n\t\t\treturn \"BLC_ROBOTS\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Not excluded\n\t\t}\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#siteUrlQueue.has(id);\n\t}\n\n\n\n\t/**\n\t * Determine whether a Link should be included, conforming to any robots filter.\n\t * @param {Link} link\n\t * @returns {boolean}\n\t */\n\t#isAllowed(link)\n\t{\n\t\tif (this.#options.honorRobotExclusions)\n\t\t{\n\t\t\tconst rebasedPathname = link.get(REBASED_URL)?.pathname;\n\n\t\t\t// @todo remove condition when/if `Link::invalidate()` is used in `HtmlChecker`\n\t\t\tif (rebasedPathname !== null)\n\t\t\t{\n\t\t\t\treturn this.#currentRobotsTxt.isAllowed(this.#options.userAgent, rebasedPathname);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#htmlUrlChecker.isPaused;\n\t}\n\n\n\n\t/**\n\t * Enqueue a page (to be crawled) if it passes filters.\n\t * @param {Link} link\n\t * @param {*} customData\n\t * @param {object} auth\n\t */\n\t#maybeEnqueuePage(link, customData, auth)\n\t{\n\t\t// Skip specific links that were excluded from checks\n\t\tif (link.get(WAS_EXCLUDED) && PAGE_EXCLUSIONS.includes(link.get(EXCLUDED_REASON)))\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst tagGroup = this.#options.tags.recursive[this.#options.filterLevel][link.get(HTML_TAG_NAME)] ?? {};\n\t\t\tconst attrSupported = link.get(HTML_ATTR_NAME) in tagGroup;\n\t\t\tconst rebasedURL = link.get(REBASED_URL);\n\t\t\tconst redirectedURL = link.get(REDIRECTED_URL);\n\n\t\t\tif (\n\t\t\t\t!attrSupported ||\n\t\t\t\tlink.get(IS_BROKEN) ||\n\t\t\t\t!link.get(IS_INTERNAL) ||\n\t\t\t\tthis.#sitePagesChecked.has(rebasedURL) ||\n\t\t\t\t!this.#isAllowed(link)\n\t\t\t   )\n\t\t\t{\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\telse if (redirectedURL !== null)\n\t\t\t{\n\t\t\t\t// Because only the final redirected page needs to be [recursively] checked,\n\t\t\t\t// all redirects are stored as pages that have been checked\n\t\t\t\tlink.get(HTTP_RESPONSE).redirects.forEach(({url}) => this.#sitePagesChecked.set(url, PAGE_WAS_CHECKED));\n\n\t\t\t\tif (!this.#sitePagesChecked.has(redirectedURL))\n\t\t\t\t{\n\t\t\t\t\tthis.#enqueuePage(redirectedURL, customData, auth);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.#options.includePage(rebasedURL))\n\t\t\t{\n\t\t\t\tthis.#enqueuePage(rebasedURL, customData, auth);\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#htmlUrlChecker.numActiveLinks;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#htmlUrlChecker.numQueuedLinks;\n\t}\n\n\n\n\tget numPages()\n\t{\n\t\treturn this.#htmlUrlChecker.numPages;\n\t}\n\n\n\n\tget numSites()\n\t{\n\t\treturn this.#siteUrlQueue.length;\n\t}\n\n\n\n\t/**\n\t * Override/mutate some options for extended behavior.\n\t * @param {object} options\n\t * @returns {object}\n\t */\n\t#overrideOptions(options)\n\t{\n\t\tconst {includeLink} = options;\n\n\t\toptions.includeLink = link =>\n\t\t{\n\t\t\tconst excludedReason = this.#getExcludedReason(link);\n\n\t\t\tif (excludedReason === undefined)\n\t\t\t{\n\t\t\t\treturn includeLink(link);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Undocumented return value type\n\t\t\t\treturn excludedReason;\n\t\t\t}\n\t\t};\n\n\t\treturn options;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#htmlUrlChecker.pause();\n\t\tthis.#siteUrlQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\t#reset()\n\t{\n\t\tthis.#currentAuth = null;\n\t\tthis.#currentCustomData = null;\n\t\tthis.#currentDone = null;\n\t\tthis.#currentPageError = null;\n\t\tthis.#currentRobotsTxt = null;\n\t\tthis.#currentSiteURL = null;\n\t\tthis.#sitePagesChecked.clear();\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#htmlUrlChecker.resume();\n\t\tthis.#siteUrlQueue.resume();\n\t\treturn this;\n\t}\n\n\n\n\t// Useless, but consistent with other classes\n\tget __cache()\n\t{\n\t\treturn this.#htmlUrlChecker.__cache;\n\t}\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,oBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,SAAA,GAAAL,sBAAA,CAAAJ,OAAA;AAAgC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAA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a,EAAEnE,UAAU,EAAED,IAAI;MAClD;IACD,CAAC,MACI,IAAI9C,qBAAA,KAAI,EAAAoB,QAAA,EAAUkG,WAAW,CAACL,UAAU,CAAC,EAC9C;MACC5G,sBAAA,KAAI,EAAAkB,YAAA,EAAAiC,aAAA,EAAArE,IAAA,CAAJ,IAAI,EAAc8H,UAAU,EAAElE,UAAU,EAAED,IAAI;IAC/C;EACD;AACD;AAAC,SAAAZ,kBAqCgBD,OAAO,EACxB;EACC,MAAM;IAACsF;EAAW,CAAC,GAAGtF,OAAO;EAE7BA,OAAO,CAACsF,WAAW,GAAGzB,IAAI,IAC1B;IACC,MAAM0B,cAAc,GAAAnH,sBAAA,CAAG,IAAI,EAAAoB,kBAAA,EAAAoE,mBAAA,EAAA1G,IAAA,CAAJ,IAAI,EAAoB2G,IAAI,CAAC;IAEpD,IAAI0B,cAAc,KAAKC,SAAS,EAChC;MACC,OAAOF,WAAW,CAACzB,IAAI,CAAC;IACzB,CAAC,MAED;MACC;MACA,OAAO0B,cAAc;IACtB;EACD,CAAC;EAED,OAAOvF,OAAO;AACf;AAAC,SAAAM,QAAA,EAcD;EACChC,qBAAA,KAAI,EAAAM,YAAA,EAAgB,IAAI;EACxBN,qBAAA,KAAI,EAAAO,kBAAA,EAAsB,IAAI;EAC9BP,qBAAA,KAAI,EAAAQ,YAAA,EAAgB,IAAI;EACxBR,qBAAA,KAAI,EAAAS,iBAAA,EAAqB,IAAI;EAC7BT,qBAAA,KAAI,EAAAU,iBAAA,EAAqB,IAAI;EAC7BV,qBAAA,KAAI,EAAAW,eAAA,EAAmB,IAAI;EAC3BlB,qBAAA,KAAI,EAAAqB,iBAAA,EAAmBqG,KAAK,CAAC,CAAC;AAC/B;AAACC,MAAA,CAAA/B,OAAA,GAAAA,OAAA,CAAArH,OAAA"}
\ No newline at end of file
diff --git a/lib-cjs/public/UrlChecker.js b/lib-cjs/public/UrlChecker.js
deleted file mode 100644
index f99becc2..00000000
--- a/lib-cjs/public/UrlChecker.js
+++ /dev/null
@@ -1,106 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
-  value: true
-});
-exports.default = void 0;
-var _checkLink = _interopRequireDefault(require("../internal/checkLink"));
-var _events = require("../internal/events");
-var _isurl = _interopRequireDefault(require("isurl"));
-var _Link = _interopRequireWildcard(require("../internal/Link"));
-var _parseOptions = _interopRequireDefault(require("../internal/parseOptions"));
-var _limitedRequestQueue = _interopRequireWildcard(require("limited-request-queue"));
-var _SafeEventEmitter = _interopRequireDefault(require("../internal/SafeEventEmitter"));
-var _urlcache = _interopRequireDefault(require("urlcache"));
-function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
-function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-class UrlChecker extends _SafeEventEmitter.default {
-  #cache;
-  #linkQueue;
-  constructor(options) {
-    super();
-    options = (0, _parseOptions.default)(options);
-    this.#cache = new _urlcache.default({
-      maxAge: options.cacheMaxAge
-    });
-    this.#linkQueue = new _limitedRequestQueue.default({
-      maxSockets: options.maxSockets,
-      maxSocketsPerHost: options.maxSocketsPerHost,
-      rateLimit: options.rateLimit
-    }).on(_limitedRequestQueue.ITEM_EVENT, async (url, {
-      auth,
-      customData,
-      link
-    }, done) => {
-      const result = await (0, _checkLink.default)(link, auth, this.#cache, options);
-      if (result.get(_Link.WAS_EXCLUDED)) {
-        this.emit(_events.JUNK_EVENT, result, customData);
-      } else {
-        this.emit(_events.LINK_EVENT, result, customData);
-      }
-
-      // Auto-starts next queue item, if any
-      // Emits REQUEST_QUEUE_END_EVENT, if not
-      done();
-    }).on(_limitedRequestQueue.END_EVENT, () => this.emit(_events.END_EVENT));
-  }
-  clearCache() {
-    this.#cache.clear();
-    return this;
-  }
-  dequeue(id) {
-    const success = this.#linkQueue.dequeue(id);
-    this.emit(_events.QUEUE_EVENT);
-    return success;
-  }
-
-  // `auth` is undocumented and for internal use only
-  enqueue(url, customData, auth = {}) {
-    let link;
-
-    // Undocumented internal use: `enqueue(Link)`
-    if (url instanceof _Link.default) {
-      link = url;
-    }
-    // Documented use: `enqueue(URL)`
-    else if ((0, _isurl.default)(url)) {
-      link = new _Link.default().resolve(url);
-    } else {
-      throw new TypeError("Invalid URL");
-    }
-    const id = this.#linkQueue.enqueue(link.get(_Link.REBASED_URL), {
-      auth,
-      customData,
-      link
-    });
-    this.emit(_events.QUEUE_EVENT);
-    return id;
-  }
-  has(id) {
-    return this.#linkQueue.has(id);
-  }
-  get isPaused() {
-    return this.#linkQueue.isPaused;
-  }
-  get numActiveLinks() {
-    return this.#linkQueue.numActive;
-  }
-  get numQueuedLinks() {
-    return this.#linkQueue.numQueued;
-  }
-  pause() {
-    this.#linkQueue.pause();
-    return this;
-  }
-  resume() {
-    this.#linkQueue.resume();
-    return this;
-  }
-  get __cache() {
-    return this.#cache;
-  }
-}
-exports.default = UrlChecker;
-module.exports = exports.default;
-//# sourceMappingURL=UrlChecker.js.map
\ No newline at end of file
diff --git a/lib-cjs/public/UrlChecker.js.map b/lib-cjs/public/UrlChecker.js.map
deleted file mode 100644
index 9fb0e6d6..00000000
--- a/lib-cjs/public/UrlChecker.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"UrlChecker.js","names":["_checkLink","_interopRequireDefault","require","_events","_isurl","_Link","_interopRequireWildcard","_parseOptions","_limitedRequestQueue","_SafeEventEmitter","_urlcache","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","UrlChecker","SafeEventEmitter","cache","linkQueue","constructor","options","parseOptions","URLCache","maxAge","cacheMaxAge","RequestQueue","maxSockets","maxSocketsPerHost","rateLimit","on","ITEM_EVENT","url","auth","customData","link","done","result","checkLink","WAS_EXCLUDED","emit","JUNK_EVENT","LINK_EVENT","REQUEST_QUEUE_END_EVENT","END_EVENT","clearCache","clear","dequeue","id","success","QUEUE_EVENT","enqueue","Link","isURL","resolve","TypeError","REBASED_URL","isPaused","numActiveLinks","numActive","numQueuedLinks","numQueued","pause","resume","__cache","exports","module"],"sources":["../../lib/public/UrlChecker.js"],"sourcesContent":["import checkLink from \"../internal/checkLink\";\nimport {END_EVENT, JUNK_EVENT, LINK_EVENT, QUEUE_EVENT} from \"../internal/events\";\nimport isURL from \"isurl\";\nimport Link, {REBASED_URL, WAS_EXCLUDED} from \"../internal/Link\";\nimport parseOptions from \"../internal/parseOptions\";\nimport RequestQueue, {ITEM_EVENT, END_EVENT as REQUEST_QUEUE_END_EVENT} from \"limited-request-queue\";\nimport SafeEventEmitter from \"../internal/SafeEventEmitter\";\nimport URLCache from \"urlcache\";\n\n\n\nexport default class UrlChecker extends SafeEventEmitter\n{\n\t#cache;\n\t#linkQueue;\n\n\n\n\tconstructor(options)\n\t{\n\t\tsuper();\n\n\t\toptions = parseOptions(options);\n\n\t\tthis.#cache = new URLCache({ maxAge:options.cacheMaxAge });\n\n\t\tthis.#linkQueue = new RequestQueue(\n\t\t{\n\t\t\tmaxSockets:        options.maxSockets,\n\t\t\tmaxSocketsPerHost: options.maxSocketsPerHost,\n\t\t\trateLimit:         options.rateLimit\n\t\t})\n\t\t.on(ITEM_EVENT, async (url, {auth, customData, link}, done) =>\n\t\t{\n\t\t\tconst result = await checkLink(link, auth, this.#cache, options);\n\n\t\t\tif (result.get(WAS_EXCLUDED))\n\t\t\t{\n\t\t\t\tthis.emit(JUNK_EVENT, result, customData);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.emit(LINK_EVENT, result, customData);\n\t\t\t}\n\n\t\t\t// Auto-starts next queue item, if any\n\t\t\t// Emits REQUEST_QUEUE_END_EVENT, if not\n\t\t\tdone();\n\t\t})\n\t\t.on(REQUEST_QUEUE_END_EVENT, () => this.emit(END_EVENT));\n\t}\n\n\n\n\tclearCache()\n\t{\n\t\tthis.#cache.clear();\n\t\treturn this;\n\t}\n\n\n\n\tdequeue(id)\n\t{\n\t\tconst success = this.#linkQueue.dequeue(id);\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn success;\n\t}\n\n\n\n\t// `auth` is undocumented and for internal use only\n\tenqueue(url, customData, auth={})\n\t{\n\t\tlet link;\n\n\t\t// Undocumented internal use: `enqueue(Link)`\n\t\tif (url instanceof Link)\n\t\t{\n\t\t\tlink = url;\n\t\t}\n\t\t// Documented use: `enqueue(URL)`\n\t\telse if (isURL(url))\n\t\t{\n\t\t\tlink = new Link().resolve(url);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new TypeError(\"Invalid URL\");\n\t\t}\n\n\t\tconst id = this.#linkQueue.enqueue(link.get(REBASED_URL), { auth, customData, link });\n\n\t\tthis.emit(QUEUE_EVENT);\n\n\t\treturn id;\n\t}\n\n\n\n\thas(id)\n\t{\n\t\treturn this.#linkQueue.has(id);\n\t}\n\n\n\n\tget isPaused()\n\t{\n\t\treturn this.#linkQueue.isPaused;\n\t}\n\n\n\n\tget numActiveLinks()\n\t{\n\t\treturn this.#linkQueue.numActive;\n\t}\n\n\n\n\tget numQueuedLinks()\n\t{\n\t\treturn this.#linkQueue.numQueued;\n\t}\n\n\n\n\tpause()\n\t{\n\t\tthis.#linkQueue.pause();\n\t\treturn this;\n\t}\n\n\n\n\tresume()\n\t{\n\t\tthis.#linkQueue.resume();\n\t\treturn this;\n\t}\n\n\n\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