blob: eaf9c2a700c5ff650c437a62b2aa1a9f1103a0a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/**
* @license
* SPDX-License-Identifier: AGPL-3.0-or-later
* This file is part of Wolfree.
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*/
// @ts-check
import AJAX from "./AJAX.js";
import PodsParser from "./PodsParser.js";
import Pods from "./Pods.js";
export default class Processor {
process = async ({
input = String(),
i2d = Boolean(),
extraPodstates = Array(),
} = {}) => {
try {
const { response } = await new AJAX().ajax({
input,
i2d,
extraPodstates,
});
try {
const { html } = new PodsParser().parse({
input,
i2d,
extraPodstates,
/** @type {any} */
response,
});
try {
new Pods().remove();
} catch (error) {
console.error(error);
}
try {
new Pods().insert({ html });
} catch (error) {
console.error(error);
}
} catch (error) {
console.error(error);
}
} catch (error) {
console.error(error);
}
};
}
|