webforai 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +972 -213
- package/dist/cjs/cli/bin.js +33 -0
- package/dist/cjs/cli/commands/webforai/index.js +86 -0
- package/dist/cjs/cli/commands/webforai/loadHtml.js +93 -0
- package/dist/cjs/cli/constants.js +34 -0
- package/dist/cjs/cli/helpers/assertContinue.js +34 -0
- package/dist/cjs/cli/helpers/inputOutputPath.js +89 -0
- package/dist/cjs/cli/helpers/inputSourcePath.js +64 -0
- package/dist/cjs/cli/helpers/selectExtractMode.js +39 -0
- package/dist/cjs/cli/helpers/selectLoader.js +44 -0
- package/dist/cjs/cli/utils.js +89 -0
- package/dist/cjs/extract-hast/index.js +4 -3
- package/dist/cjs/extract-hast/readability.js +28 -61
- package/dist/cjs/extract-hast/strongly.js +2 -1
- package/dist/cjs/extract-hast/utils.js +0 -15
- package/dist/cjs/html-to-mdast.js +6 -6
- package/dist/cjs/link-replacer.js +10 -5
- package/dist/cjs/loaders/playwright.js +36 -7
- package/dist/cjs/mdast-handlers/custom-br-handler.js +31 -0
- package/dist/cjs/mdast-to-markdown.js +1 -1
- package/dist/cjs/utils/hast-utils.js +71 -0
- package/dist/cli/bin.js +11 -0
- package/dist/cli/commands/webforai/index.js +53 -0
- package/dist/cli/commands/webforai/loadHtml.js +60 -0
- package/dist/cli/constants.js +9 -0
- package/dist/cli/helpers/assertContinue.js +11 -0
- package/dist/cli/helpers/inputOutputPath.js +56 -0
- package/dist/cli/helpers/inputSourcePath.js +31 -0
- package/dist/cli/helpers/selectExtractMode.js +16 -0
- package/dist/cli/helpers/selectLoader.js +21 -0
- package/dist/cli/utils.js +52 -0
- package/dist/extract-hast/index.js +4 -3
- package/dist/extract-hast/readability.js +29 -62
- package/dist/extract-hast/strongly.js +2 -1
- package/dist/extract-hast/utils.js +0 -14
- package/dist/html-to-mdast.js +6 -6
- package/dist/link-replacer.js +10 -5
- package/dist/loaders/playwright.js +36 -7
- package/dist/mdast-handlers/custom-br-handler.js +8 -0
- package/dist/mdast-to-markdown.js +1 -1
- package/dist/types/cli/bin.js.map +1 -0
- package/dist/types/cli/commands/webforai/index.d.ts +6 -0
- package/dist/types/cli/commands/webforai/index.js.map +1 -0
- package/dist/types/cli/commands/webforai/loadHtml.d.ts +3 -0
- package/dist/types/cli/commands/webforai/loadHtml.js.map +1 -0
- package/dist/types/cli/constants.d.ts +5 -0
- package/dist/types/cli/constants.js.map +1 -0
- package/dist/types/cli/helpers/assertContinue.d.ts +1 -0
- package/dist/types/cli/helpers/assertContinue.js.map +1 -0
- package/dist/types/cli/helpers/inputOutputPath.d.ts +1 -0
- package/dist/types/cli/helpers/inputOutputPath.js.map +1 -0
- package/dist/types/cli/helpers/inputSourcePath.d.ts +1 -0
- package/dist/types/cli/helpers/inputSourcePath.js.map +1 -0
- package/dist/types/cli/helpers/selectExtractMode.d.ts +1 -0
- package/dist/types/cli/helpers/selectExtractMode.js.map +1 -0
- package/dist/types/cli/helpers/selectLoader.d.ts +1 -0
- package/dist/types/cli/helpers/selectLoader.js.map +1 -0
- package/dist/types/cli/utils.d.ts +32 -0
- package/dist/types/cli/utils.js.map +1 -0
- package/dist/types/extract-hast/index.d.ts +9 -4
- package/dist/types/extract-hast/index.js.map +1 -1
- package/dist/types/extract-hast/readability.d.ts +2 -1
- package/dist/types/extract-hast/readability.js.map +1 -1
- package/dist/types/extract-hast/strongly.d.ts +2 -1
- package/dist/types/extract-hast/strongly.js.map +1 -1
- package/dist/types/extract-hast/utils.d.ts +0 -1
- package/dist/types/extract-hast/utils.js.map +1 -1
- package/dist/types/html-to-mdast.d.ts +4 -0
- package/dist/types/html-to-mdast.js.map +1 -1
- package/dist/types/link-replacer.d.ts +1 -1
- package/dist/types/link-replacer.js.map +1 -1
- package/dist/types/loaders/playwright.d.ts +8 -2
- package/dist/types/loaders/playwright.js.map +1 -1
- package/dist/types/mdast-handlers/custom-br-handler.d.ts +2 -0
- package/dist/types/mdast-handlers/custom-br-handler.js.map +1 -0
- package/dist/types/mdast-to-markdown.js.map +1 -1
- package/dist/types/utils/hast-utils.d.ts +4 -0
- package/dist/types/utils/hast-utils.js.map +1 -0
- package/dist/utils/hast-utils.js +46 -0
- package/package.json +18 -17
- package/dist/cjs/bin.js +0 -254
- package/dist/cjs/html-to-markdown.test.js +0 -146
- package/dist/cjs/link-replacer.test.js +0 -47
- package/dist/cjs/loaders/fetch.test.js +0 -9
- package/dist/cjs/loaders/playwright.test.js +0 -17
- package/dist/cjs/loaders/puppeteer.test.js +0 -17
- package/dist/cjs/utils/bin-utils.js +0 -124
- package/dist/html-to-markdown.test.js +0 -124
- package/dist/link-replacer.test.js +0 -47
- package/dist/loaders/fetch.test.js +0 -9
- package/dist/loaders/playwright.test.js +0 -17
- package/dist/loaders/puppeteer.test.js +0 -17
- package/dist/types/bin.js.map +0 -1
- package/dist/types/utils/bin-utils.d.ts +0 -5
- package/dist/types/utils/bin-utils.js.map +0 -1
- package/dist/utils/bin-utils.js +0 -87
- /package/dist/types/{bin.d.ts → cli/bin.d.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_prompts = require("@clack/prompts");
|
|
25
|
+
var import_commander = require("commander");
|
|
26
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
27
|
+
var import_package = __toESM(require("../../package.json"), 1);
|
|
28
|
+
var import_webforai = require("./commands/webforai");
|
|
29
|
+
var import_constants = require("./constants");
|
|
30
|
+
import_commander.program.name("webforai").description("CLI tool for ultra-precise HTML to Markdown conversion").version(import_package.default.version, "-v, --version", "output the current version");
|
|
31
|
+
import_commander.program.argument("[source]", "URL or path to process").option("-o, --output <output>", "Path to output file or directory").option("-m, --mode <mode>", `Processing mode (${import_constants.MODES.join(", ")})`).option("-l, --loader <loader>", `Loader to use (${import_constants.LOADERS.join(", ")})`).option("-d, --debug", "output extra debugging information").action(import_webforai.webforaiCommand);
|
|
32
|
+
(0, import_prompts.intro)(import_picocolors.default.inverse(`webforai CLI version ${import_package.default.version}`));
|
|
33
|
+
import_commander.program.parse();
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var webforai_exports = {};
|
|
30
|
+
__export(webforai_exports, {
|
|
31
|
+
webforaiCommand: () => webforaiCommand
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(webforai_exports);
|
|
34
|
+
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
35
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
+
var import_prompts = require("@clack/prompts");
|
|
37
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
38
|
+
var import_package = __toESM(require("../../../../package.json"), 1);
|
|
39
|
+
var import_html_to_markdown = require("../../../html-to-markdown");
|
|
40
|
+
var import_inputOutputPath = require("../../helpers/inputOutputPath");
|
|
41
|
+
var import_inputSourcePath = require("../../helpers/inputSourcePath");
|
|
42
|
+
var import_selectExtractMode = require("../../helpers/selectExtractMode");
|
|
43
|
+
var import_selectLoader = require("../../helpers/selectLoader");
|
|
44
|
+
var import_utils = require("../../utils");
|
|
45
|
+
var import_loadHtml = require("./loadHtml");
|
|
46
|
+
const aiModeOptions = { linkAsText: true, tableAsText: true, hideImage: true };
|
|
47
|
+
const readabilityModeOptions = { linkAsText: false, tableAsText: false, hideImage: false };
|
|
48
|
+
const webforaiCommand = async (initialPath, options) => {
|
|
49
|
+
(0, import_prompts.intro)(import_picocolors.default.bold(import_picocolors.default.green(`webforai CLI version ${import_package.default.version}`)));
|
|
50
|
+
const sourcePath = initialPath ?? await (0, import_inputSourcePath.inputSourcePath)();
|
|
51
|
+
options.debug && console.debug(`sourcePath: ${sourcePath}`);
|
|
52
|
+
const loader = (0, import_utils.isUrl)(sourcePath) ? options.loader ?? await (0, import_selectLoader.selectLoader)() : "local";
|
|
53
|
+
options.debug && console.debug(`loader: ${loader}`);
|
|
54
|
+
const outputPath = options.output ?? await (0, import_inputOutputPath.inputOutputPath)(sourcePath);
|
|
55
|
+
options.debug && console.debug(`outputPath: ${outputPath}`);
|
|
56
|
+
const mode = options.mode ?? await (0, import_selectExtractMode.selectExtractMode)();
|
|
57
|
+
options.debug && console.debug(`mode: ${mode}`);
|
|
58
|
+
let html;
|
|
59
|
+
const s = (0, import_prompts.spinner)();
|
|
60
|
+
try {
|
|
61
|
+
s.start("Loading content...");
|
|
62
|
+
html = await (0, import_loadHtml.loadHtml)(sourcePath, loader, { debug: options.debug });
|
|
63
|
+
s.stop(import_picocolors.default.green("Content loaded!"));
|
|
64
|
+
} catch (error) {
|
|
65
|
+
s.stop(import_picocolors.default.red("Content loading failed!"));
|
|
66
|
+
console.error(error);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
options.debug && console.debug(`html: ${html}`);
|
|
70
|
+
const markdown = (0, import_html_to_markdown.htmlToMarkdown)(html, {
|
|
71
|
+
baseUrl: (0, import_utils.isUrl)(sourcePath) ? sourcePath : void 0,
|
|
72
|
+
...mode === "ai" ? aiModeOptions : readabilityModeOptions
|
|
73
|
+
});
|
|
74
|
+
options.debug && console.debug(`markdown: ${markdown}`);
|
|
75
|
+
const directory = import_node_path.default.dirname(outputPath);
|
|
76
|
+
const isDirectoryExists = await import_promises.default.stat(directory).then((stat) => stat.isDirectory());
|
|
77
|
+
if (!isDirectoryExists) {
|
|
78
|
+
await import_promises.default.mkdir(directory, { recursive: true });
|
|
79
|
+
}
|
|
80
|
+
await import_promises.default.writeFile(outputPath, markdown);
|
|
81
|
+
(0, import_prompts.outro)(import_picocolors.default.green(`${import_picocolors.default.bold("Done!")} Markdown saved to ${outputPath}`));
|
|
82
|
+
};
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
webforaiCommand
|
|
86
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var loadHtml_exports = {};
|
|
30
|
+
__export(loadHtml_exports, {
|
|
31
|
+
loadHtml: () => loadHtml
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(loadHtml_exports);
|
|
34
|
+
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
35
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
36
|
+
var import_playwright_core = require("playwright-core");
|
|
37
|
+
var import_package = __toESM(require("playwright-core/package.json"), 1);
|
|
38
|
+
var import_fetch = require("../../../loaders/fetch");
|
|
39
|
+
var import_playwright = require("../../../loaders/playwright");
|
|
40
|
+
const checkPlaywrightAvailable = async () => {
|
|
41
|
+
const path = import_playwright_core.chromium.executablePath();
|
|
42
|
+
const isAvailable = await import_promises.default.access(path).catch(() => false);
|
|
43
|
+
return !!isAvailable;
|
|
44
|
+
};
|
|
45
|
+
const loadHtml = async (sourcePath, loader, options) => {
|
|
46
|
+
if (loader === "local") {
|
|
47
|
+
options.debug && console.debug(`Loading HTML from local file: ${sourcePath}`);
|
|
48
|
+
const content = await import_promises.default.readFile(sourcePath, "utf-8");
|
|
49
|
+
options.debug && console.debug(`HTML loaded: ${content.slice(0, 100)}`);
|
|
50
|
+
return content;
|
|
51
|
+
}
|
|
52
|
+
if (loader === "fetch") {
|
|
53
|
+
options.debug && console.debug(`Loading HTML from URL: ${sourcePath}`);
|
|
54
|
+
const content = await (0, import_fetch.loadHtml)(sourcePath);
|
|
55
|
+
options.debug && console.debug(`HTML loaded: ${content.slice(0, 100)}`);
|
|
56
|
+
return content;
|
|
57
|
+
}
|
|
58
|
+
if (loader === "playwright") {
|
|
59
|
+
options.debug && console.debug(`Loading HTML from playwright: ${sourcePath}`);
|
|
60
|
+
const isPlaywrightAvailable = await checkPlaywrightAvailable();
|
|
61
|
+
options.debug && console.debug(`Playwright available: ${isPlaywrightAvailable}`);
|
|
62
|
+
if (!isPlaywrightAvailable) {
|
|
63
|
+
const message = [
|
|
64
|
+
"To use playwright loader, you need to install playwright.",
|
|
65
|
+
"You can install it by running:",
|
|
66
|
+
"",
|
|
67
|
+
` ${import_picocolors.default.bold(`npx playwright@${import_package.default.version} install chromium`)} `,
|
|
68
|
+
"",
|
|
69
|
+
"Hint1: If you get warning like this:",
|
|
70
|
+
"WARNING: It looks like you are running 'npx playwright install' without first installing your project's dependencies. ",
|
|
71
|
+
`${import_picocolors.default.bold("Ignore this warning.")}`,
|
|
72
|
+
"",
|
|
73
|
+
"Hint2: If you get message like this:",
|
|
74
|
+
"Host system is missing dependencies to run browsers.",
|
|
75
|
+
"You should install dependencies by running:",
|
|
76
|
+
"",
|
|
77
|
+
` ${import_picocolors.default.bold(`sudo npx playwright@${import_package.default.version} install-deps`)} `,
|
|
78
|
+
"",
|
|
79
|
+
import_picocolors.default.gray("Note: Good luck with that.")
|
|
80
|
+
];
|
|
81
|
+
console.info(message.join("\n"));
|
|
82
|
+
throw new Error("Playwright is not available");
|
|
83
|
+
}
|
|
84
|
+
const content = await (0, import_playwright.loadHtml)(sourcePath);
|
|
85
|
+
options.debug && console.debug(`HTML loaded: ${content.slice(0, 100)}`);
|
|
86
|
+
return content;
|
|
87
|
+
}
|
|
88
|
+
throw new Error(`Unsupported loader: ${loader}`);
|
|
89
|
+
};
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
loadHtml
|
|
93
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var constants_exports = {};
|
|
20
|
+
__export(constants_exports, {
|
|
21
|
+
DEFAULT_PATH: () => DEFAULT_PATH,
|
|
22
|
+
LOADERS: () => LOADERS,
|
|
23
|
+
MODES: () => MODES
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(constants_exports);
|
|
26
|
+
const DEFAULT_PATH = "https://example.com";
|
|
27
|
+
const LOADERS = ["fetch", "playwright"];
|
|
28
|
+
const MODES = ["default", "ai"];
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
DEFAULT_PATH,
|
|
32
|
+
LOADERS,
|
|
33
|
+
MODES
|
|
34
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var assertContinue_exports = {};
|
|
20
|
+
__export(assertContinue_exports, {
|
|
21
|
+
assertContinue: () => assertContinue
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(assertContinue_exports);
|
|
24
|
+
var import_prompts = require("@clack/prompts");
|
|
25
|
+
function assertContinue(message, cancelMessage = "Canceled.") {
|
|
26
|
+
if ((0, import_prompts.isCancel)(message)) {
|
|
27
|
+
(0, import_prompts.cancel)(cancelMessage);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
assertContinue
|
|
34
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var inputOutputPath_exports = {};
|
|
30
|
+
__export(inputOutputPath_exports, {
|
|
31
|
+
inputOutputPath: () => inputOutputPath
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(inputOutputPath_exports);
|
|
34
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
+
var import_prompts = require("@clack/prompts");
|
|
36
|
+
var import_utils = require("../utils");
|
|
37
|
+
var import_assertContinue = require("./assertContinue");
|
|
38
|
+
const inputOutputPath = async (sourcePath) => {
|
|
39
|
+
const outputPath = await (0, import_prompts.text)({
|
|
40
|
+
message: "Enter the output file path:",
|
|
41
|
+
placeholder: "output.md",
|
|
42
|
+
initialValue: (0, import_utils.sourcePathToOutputPath)(sourcePath),
|
|
43
|
+
validate: (value) => {
|
|
44
|
+
if (value.trim() === "") {
|
|
45
|
+
return "Output path is required";
|
|
46
|
+
}
|
|
47
|
+
if (import_node_fs.default.existsSync(value) && import_node_fs.default.statSync(value).isDirectory()) {
|
|
48
|
+
return "No directory can be specified.";
|
|
49
|
+
}
|
|
50
|
+
if (!import_node_fs.default.existsSync(value) && value.endsWith("/")) {
|
|
51
|
+
return "No directory can be specified.";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
(0, import_assertContinue.assertContinue)(outputPath);
|
|
56
|
+
if (!import_node_fs.default.existsSync(outputPath)) {
|
|
57
|
+
return outputPath;
|
|
58
|
+
}
|
|
59
|
+
const isOutputFileOverwrite = await (0, import_prompts.confirm)({
|
|
60
|
+
message: "The file already exists. Overwrite?",
|
|
61
|
+
initialValue: false
|
|
62
|
+
});
|
|
63
|
+
(0, import_assertContinue.assertContinue)(isOutputFileOverwrite);
|
|
64
|
+
if (isOutputFileOverwrite) {
|
|
65
|
+
return outputPath;
|
|
66
|
+
}
|
|
67
|
+
const escapedOutputPath = await (0, import_prompts.text)({
|
|
68
|
+
message: "Enter the output file path:",
|
|
69
|
+
placeholder: "output.md",
|
|
70
|
+
initialValue: (0, import_utils.getNextAvailableFilePath)(outputPath),
|
|
71
|
+
validate: (value) => {
|
|
72
|
+
if (value.trim() === "") {
|
|
73
|
+
return "Output path is required";
|
|
74
|
+
}
|
|
75
|
+
if (import_node_fs.default.existsSync(value)) {
|
|
76
|
+
return "The file already exists";
|
|
77
|
+
}
|
|
78
|
+
if (!import_node_fs.default.existsSync(value) && value.endsWith("/")) {
|
|
79
|
+
return "No directory can be specified.";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
(0, import_assertContinue.assertContinue)(escapedOutputPath);
|
|
84
|
+
return escapedOutputPath;
|
|
85
|
+
};
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
88
|
+
inputOutputPath
|
|
89
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var inputSourcePath_exports = {};
|
|
30
|
+
__export(inputSourcePath_exports, {
|
|
31
|
+
inputSourcePath: () => inputSourcePath
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(inputSourcePath_exports);
|
|
34
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
+
var import_prompts = require("@clack/prompts");
|
|
36
|
+
var import_constants = require("../constants");
|
|
37
|
+
var import_utils = require("../utils");
|
|
38
|
+
var import_assertContinue = require("./assertContinue");
|
|
39
|
+
const inputSourcePath = async () => {
|
|
40
|
+
const result = await (0, import_prompts.text)({
|
|
41
|
+
message: "Enter the URL or html path to be converted to markdown:",
|
|
42
|
+
placeholder: import_constants.DEFAULT_PATH,
|
|
43
|
+
initialValue: "",
|
|
44
|
+
validate: (value) => {
|
|
45
|
+
if (value.trim() === "") {
|
|
46
|
+
return "Source is required";
|
|
47
|
+
}
|
|
48
|
+
if (!(0, import_utils.isUrl)(value)) {
|
|
49
|
+
if (!import_node_fs.default.existsSync(value)) {
|
|
50
|
+
return "It appears that you are specifying a local file, but the file cannot be found. hint: when specifying a url, start with http or https.";
|
|
51
|
+
}
|
|
52
|
+
if (import_node_fs.default.statSync(value).isDirectory()) {
|
|
53
|
+
return "You are specifying a local file, but you cannot specify a directory. hint: when specifying a url, start with http or https.";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
(0, import_assertContinue.assertContinue)(result);
|
|
59
|
+
return result;
|
|
60
|
+
};
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
inputSourcePath
|
|
64
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var selectExtractMode_exports = {};
|
|
20
|
+
__export(selectExtractMode_exports, {
|
|
21
|
+
selectExtractMode: () => selectExtractMode
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(selectExtractMode_exports);
|
|
24
|
+
var import_prompts = require("@clack/prompts");
|
|
25
|
+
var import_constants = require("../constants");
|
|
26
|
+
var import_assertContinue = require("./assertContinue");
|
|
27
|
+
const selectExtractMode = async () => {
|
|
28
|
+
const result = await (0, import_prompts.select)({
|
|
29
|
+
message: "Select processing mode:",
|
|
30
|
+
options: import_constants.MODES.map((mode) => ({ value: mode, label: mode })),
|
|
31
|
+
initialValue: import_constants.MODES[0]
|
|
32
|
+
});
|
|
33
|
+
(0, import_assertContinue.assertContinue)(result);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
selectExtractMode
|
|
39
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var selectLoader_exports = {};
|
|
20
|
+
__export(selectLoader_exports, {
|
|
21
|
+
selectLoader: () => selectLoader
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(selectLoader_exports);
|
|
24
|
+
var import_prompts = require("@clack/prompts");
|
|
25
|
+
var import_constants = require("../constants");
|
|
26
|
+
var import_assertContinue = require("./assertContinue");
|
|
27
|
+
const loadersHint = {
|
|
28
|
+
fetch: "Fetch HTML content from the given URL",
|
|
29
|
+
playwright: "Retrieve HTML content after rendering using Playwright; Playwright must be installed in advance.",
|
|
30
|
+
puppeteer: "Retrieve HTML content after rendering using Puppeteer; Puppeteer must be installed in advance."
|
|
31
|
+
};
|
|
32
|
+
const selectLoader = async () => {
|
|
33
|
+
const result = await (0, import_prompts.select)({
|
|
34
|
+
message: "Select loader:",
|
|
35
|
+
initialValue: "fetch",
|
|
36
|
+
options: import_constants.LOADERS.map((mode) => ({ value: mode, label: mode, hint: loadersHint[mode] || "" }))
|
|
37
|
+
});
|
|
38
|
+
(0, import_assertContinue.assertContinue)(result);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
selectLoader
|
|
44
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
changeFileExtension: () => changeFileExtension,
|
|
32
|
+
getNextAvailableFilePath: () => getNextAvailableFilePath,
|
|
33
|
+
isUrl: () => isUrl,
|
|
34
|
+
sourcePathToOutputPath: () => sourcePathToOutputPath,
|
|
35
|
+
urlToFilename: () => urlToFilename
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(utils_exports);
|
|
38
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
39
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
40
|
+
const isUrl = (maybeUrl) => {
|
|
41
|
+
try {
|
|
42
|
+
new URL(maybeUrl);
|
|
43
|
+
return true;
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
function changeFileExtension(filePath, newExtension) {
|
|
49
|
+
const parsed = import_node_path.default.parse(filePath);
|
|
50
|
+
const ext = newExtension.startsWith(".") ? newExtension : `.${newExtension}`;
|
|
51
|
+
return import_node_path.default.format({ ...parsed, ext });
|
|
52
|
+
}
|
|
53
|
+
function urlToFilename(url) {
|
|
54
|
+
try {
|
|
55
|
+
const urlObj = new URL(url);
|
|
56
|
+
const hostname = urlObj.hostname.startsWith("www.") ? urlObj.hostname.slice(4) : urlObj.hostname;
|
|
57
|
+
const domainParts = hostname.split(".").slice(-2).join("-");
|
|
58
|
+
const pathParts = urlObj.pathname.split("/").filter(Boolean);
|
|
59
|
+
const relevantPathParts = pathParts.slice(-2).map(decodeURIComponent).join("-");
|
|
60
|
+
let filename = [domainParts, relevantPathParts].filter(Boolean).join("-");
|
|
61
|
+
filename = filename.toLowerCase().replace(/[<>:"/\\|?*\x00-\x1F]/g, "").replace(/[\s.]+/g, "-").replace(/^-+|-+$/g, "");
|
|
62
|
+
return filename || "output";
|
|
63
|
+
} catch {
|
|
64
|
+
return "output";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const sourcePathToOutputPath = (sourcePath) => isUrl(sourcePath) ? `${urlToFilename(sourcePath)}.md` : changeFileExtension(sourcePath, "md");
|
|
68
|
+
function getNextAvailableFilePath(filePath) {
|
|
69
|
+
const parsed = import_node_path.default.parse(filePath);
|
|
70
|
+
const dir = parsed.dir;
|
|
71
|
+
const ext = parsed.ext;
|
|
72
|
+
const baseName = parsed.name.replace(/_\d+$/, "");
|
|
73
|
+
const match = parsed.name.match(/_(\d+)$/);
|
|
74
|
+
let counter = match ? Number(match[1]) + 1 : 1;
|
|
75
|
+
let newPath = import_node_path.default.join(dir, `${baseName}_${counter}${ext}`);
|
|
76
|
+
while (import_node_fs.default.existsSync(newPath)) {
|
|
77
|
+
counter++;
|
|
78
|
+
newPath = import_node_path.default.join(dir, `${baseName}_${counter}${ext}`);
|
|
79
|
+
}
|
|
80
|
+
return newPath;
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
changeFileExtension,
|
|
85
|
+
getNextAvailableFilePath,
|
|
86
|
+
isUrl,
|
|
87
|
+
sourcePathToOutputPath,
|
|
88
|
+
urlToFilename
|
|
89
|
+
});
|
|
@@ -30,17 +30,18 @@ const PRESET_EXTRACT_HAST = {
|
|
|
30
30
|
readability: import_readability.readabilityExtractHast
|
|
31
31
|
};
|
|
32
32
|
const DEFAULT_EXTRACT_HAST = ["readability"];
|
|
33
|
-
const extractHast = (
|
|
33
|
+
const extractHast = (params, extractors = DEFAULT_EXTRACT_HAST) => {
|
|
34
|
+
const { hast, lang } = params;
|
|
34
35
|
const _extractors = Array.isArray(extractors) ? extractors : [extractors];
|
|
35
36
|
const extracted = _extractors.reduce((acc, extractor) => {
|
|
36
37
|
if (extractor === false) {
|
|
37
38
|
return acc;
|
|
38
39
|
}
|
|
39
40
|
if (typeof extractor === "string" && extractor in PRESET_EXTRACT_HAST) {
|
|
40
|
-
return PRESET_EXTRACT_HAST[extractor](acc);
|
|
41
|
+
return PRESET_EXTRACT_HAST[extractor]({ hast: acc, lang });
|
|
41
42
|
}
|
|
42
43
|
if (typeof extractor === "function") {
|
|
43
|
-
return extractor(acc);
|
|
44
|
+
return extractor({ hast: acc, lang });
|
|
44
45
|
}
|
|
45
46
|
throw new Error(`Invalid extractor: ${extractor}`);
|
|
46
47
|
}, hast) || hast;
|