@clazic/kordoc 2.4.5 → 2.4.7
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/{batch-provider-PNDCSGQW.js → batch-provider-XI2EPODC.js} +9 -3
- package/dist/batch-provider-XI2EPODC.js.map +1 -0
- package/dist/{chunk-CG3DV7QG.js → chunk-5DD75UUX.js} +2 -2
- package/dist/{chunk-ATB6T3SG.js → chunk-GITPGCCA.js} +4 -3
- package/dist/chunk-GITPGCCA.js.map +1 -0
- package/dist/cli.js +5 -5
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{resolve-TZVGVOVD.js → resolve-SUU5Q6DJ.js} +3 -3
- package/dist/{utils-LG2ALGSE.js → utils-7LOIY3O6.js} +2 -2
- package/dist/{watch-Z3CENX4H.js → watch-HUIKUPMG.js} +3 -3
- package/package.json +1 -1
- package/dist/batch-provider-PNDCSGQW.js.map +0 -1
- package/dist/chunk-ATB6T3SG.js.map +0 -1
- /package/dist/{chunk-CG3DV7QG.js.map → chunk-5DD75UUX.js.map} +0 -0
- /package/dist/{resolve-TZVGVOVD.js.map → resolve-SUU5Q6DJ.js.map} +0 -0
- /package/dist/{utils-LG2ALGSE.js.map → utils-7LOIY3O6.js.map} +0 -0
- /package/dist/{watch-Z3CENX4H.js.map → watch-HUIKUPMG.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -2245,14 +2245,20 @@ __export(batch_provider_exports, {
|
|
|
2245
2245
|
DEFAULT_BATCH_SIZES: () => DEFAULT_BATCH_SIZES,
|
|
2246
2246
|
createBatchCliProvider: () => createBatchCliProvider
|
|
2247
2247
|
});
|
|
2248
|
-
import { spawn } from "child_process";
|
|
2248
|
+
import { spawn, execSync as execSync2 } from "child_process";
|
|
2249
2249
|
import { writeFileSync as writeFileSync2, readFileSync as readFileSync2, unlinkSync as unlinkSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
2250
2250
|
import { join as join2 } from "path";
|
|
2251
2251
|
import { tmpdir as tmpdir2 } from "os";
|
|
2252
2252
|
function getBatchTempDir() {
|
|
2253
2253
|
if (!_batchTempDir) {
|
|
2254
|
-
_batchTempDir = join2(process.cwd(), "
|
|
2254
|
+
_batchTempDir = join2(process.cwd(), ".kordoc_ocr_tmp");
|
|
2255
2255
|
mkdirSync2(_batchTempDir, { recursive: true });
|
|
2256
|
+
if (process.platform === "win32") {
|
|
2257
|
+
try {
|
|
2258
|
+
execSync2(`attrib +h "${_batchTempDir}"`, { stdio: "ignore" });
|
|
2259
|
+
} catch {
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2256
2262
|
}
|
|
2257
2263
|
return _batchTempDir;
|
|
2258
2264
|
}
|
|
@@ -2820,7 +2826,7 @@ import JSZip2 from "jszip";
|
|
|
2820
2826
|
import { DOMParser } from "@xmldom/xmldom";
|
|
2821
2827
|
|
|
2822
2828
|
// src/utils.ts
|
|
2823
|
-
var VERSION = true ? "2.4.
|
|
2829
|
+
var VERSION = true ? "2.4.7" : "0.0.0-dev";
|
|
2824
2830
|
function toArrayBuffer(buf) {
|
|
2825
2831
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
2826
2832
|
return buf.buffer;
|
|
@@ -6426,6 +6432,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
6426
6432
|
} catch {
|
|
6427
6433
|
}
|
|
6428
6434
|
}
|
|
6435
|
+
allOcrBlocks.sort((a, b) => (a.pageNumber ?? 0) - (b.pageNumber ?? 0));
|
|
6429
6436
|
ocrBlocks = allOcrBlocks;
|
|
6430
6437
|
} else {
|
|
6431
6438
|
try {
|