template-replacement 3.3.3 → 3.5.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/.editorconfig +8 -0
- package/.oxfmtrc.jsonc +7 -0
- package/.oxlintrc.json +3 -0
- package/README.md +39 -9
- package/core/base.ts +54 -55
- package/core/general.ts +37 -9
- package/core/sign.ts +43 -8
- package/dispatcher/general.ts +2 -1
- package/dispatcher/sign.ts +2 -1
- package/dispatcher/workerGeneral.ts +1 -1
- package/dispatcher/workerSign.ts +1 -1
- package/dist/base-DQz39fXI.js +249 -0
- package/dist/index-oILo_kXG.js +46 -0
- package/dist/main/general.js +1911 -2031
- package/dist/main/sign.js +2141 -2252
- package/dist/replace/general.js +287 -390
- package/dist/replace/sign.js +307 -401
- package/download/index.ts +13 -13
- package/download/stream.ts +29 -28
- package/eslint.config.ts +28 -0
- package/fileSystem/db/index.ts +25 -25
- package/fileSystem/db/indexedDBCache.ts +145 -143
- package/fileSystem/index.ts +5 -8
- package/fileSystem/interface.ts +4 -5
- package/fileSystem/opfs/index.ts +40 -36
- package/helper/index.ts +136 -125
- package/index.ts +6 -6
- package/office/zip.ts +106 -97
- package/package.json +14 -8
- package/replace/base.ts +203 -222
- package/replace/general.ts +44 -24
- package/replace/image.ts +100 -92
- package/replace/interface.ts +29 -24
- package/replace/paramsData.ts +107 -95
- package/replace/sign.ts +72 -54
- package/task/urlDownloadTask.ts +53 -55
- package/temp/index.ts +139 -124
- package/temp/interface.ts +8 -8
- package/tsconfig.json +1 -1
- package/vite.config.ts +11 -14
- package/worker/child/agency.ts +49 -41
- package/worker/child/base.ts +125 -89
- package/worker/child/general.ts +2 -3
- package/worker/child/sign.ts +4 -4
- package/worker/index.ts +52 -53
- package/worker/interface.ts +9 -6
- package/worker/main/general.ts +5 -5
- package/worker/main/index.ts +192 -67
- package/worker/main/sign.ts +5 -5
- package/worker/type.ts +16 -15
- package/dist/assets/template_replacement_core_wasm_bg.wasm +0 -0
- package/dist/assets/template_replacement_sign_core_wasm_bg.wasm +0 -0
- package/dist/base-CJv023nf.js +0 -284
- package/dist/general.d.ts +0 -1
- package/dist/index-tFDVIkZX.js +0 -46
- package/dist/sign.d.ts +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
class h {
|
|
2
|
+
#s;
|
|
3
|
+
#t = 0;
|
|
4
|
+
#e = [];
|
|
5
|
+
#r = [];
|
|
6
|
+
constructor(r, s) {
|
|
7
|
+
if (this.#s = Number(s), this.#s < 1)
|
|
8
|
+
try {
|
|
9
|
+
this.#s = navigator.hardwareConcurrency < 8 ? navigator.hardwareConcurrency : 8;
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
this.#s < 1 && (this.#s = 1);
|
|
13
|
+
for (let t = 0; t < this.#s; t++)
|
|
14
|
+
this.#i(r);
|
|
15
|
+
}
|
|
16
|
+
#i(r) {
|
|
17
|
+
const s = new r();
|
|
18
|
+
s.onmessage = async (t) => {
|
|
19
|
+
const i = [];
|
|
20
|
+
for (const e of this.#r)
|
|
21
|
+
i.push(e(t));
|
|
22
|
+
const o = await Promise.all(i);
|
|
23
|
+
for (const e of o)
|
|
24
|
+
e && s.postMessage(e);
|
|
25
|
+
}, this.#e.push(s);
|
|
26
|
+
}
|
|
27
|
+
concurrency() {
|
|
28
|
+
return this.#s;
|
|
29
|
+
}
|
|
30
|
+
postMessage(r, s) {
|
|
31
|
+
this.#e[++this.#t] || (this.#t = 0), this.#e[this.#t].postMessage(r, s);
|
|
32
|
+
}
|
|
33
|
+
addListener(r) {
|
|
34
|
+
this.#r.push(r);
|
|
35
|
+
}
|
|
36
|
+
removeListener(r) {
|
|
37
|
+
for (const s in this.#r)
|
|
38
|
+
if (this.#r[s] == r) {
|
|
39
|
+
this.#r.splice(s, 1);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
h as w
|
|
46
|
+
};
|