@clazic/kordoc 2.3.2 → 2.3.3

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/utils.ts
4
- var VERSION = true ? "2.3.2" : "0.0.0-dev";
4
+ var VERSION = true ? "2.3.3" : "0.0.0-dev";
5
5
  function toArrayBuffer(buf) {
6
6
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
7
7
  return buf.buffer;
@@ -90,4 +90,4 @@ export {
90
90
  sanitizeHref,
91
91
  classifyError
92
92
  };
93
- //# sourceMappingURL=chunk-STIKJGEA.js.map
93
+ //# sourceMappingURL=chunk-NU3KFVVZ.js.map
@@ -6,7 +6,7 @@ import {
6
6
  precheckZipSize,
7
7
  sanitizeHref,
8
8
  toArrayBuffer
9
- } from "./chunk-STIKJGEA.js";
9
+ } from "./chunk-NU3KFVVZ.js";
10
10
  import {
11
11
  parsePageRange
12
12
  } from "./chunk-MOL7MDBG.js";
@@ -5432,15 +5432,26 @@ async function parsePdfDocument(buffer, options) {
5432
5432
  warnings.push({ page: i, message: `\uD398\uC774\uC9C0 ${i} \uD30C\uC2F1 \uC2E4\uD328: ${pageErr instanceof Error ? pageErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
5433
5433
  }
5434
5434
  };
5435
- const sampleCount = Math.min(5, targetPageNums.length);
5436
- for (let si = 0; si < sampleCount; si++) {
5435
+ const SAMPLE_SIZE = Math.min(10, targetPageNums.length);
5436
+ const sampledIndices = /* @__PURE__ */ new Set();
5437
+ if (targetPageNums.length <= SAMPLE_SIZE) {
5438
+ for (let i = 0; i < targetPageNums.length; i++) sampledIndices.add(i);
5439
+ } else {
5440
+ for (let i = 0; i < SAMPLE_SIZE; i++) {
5441
+ const idx = Math.round(i * (targetPageNums.length - 1) / (SAMPLE_SIZE - 1));
5442
+ sampledIndices.add(idx);
5443
+ }
5444
+ }
5445
+ for (const si of sampledIndices) {
5437
5446
  await parseSinglePage(targetPageNums[si]);
5438
5447
  }
5439
- const sampleParsed = parsedPages || sampleCount;
5448
+ const sampleParsed = parsedPages || sampledIndices.size;
5440
5449
  const isImageBased = totalChars / Math.max(sampleParsed, 1) < 10;
5441
5450
  if (!isImageBased) {
5442
- for (let si = sampleCount; si < targetPageNums.length; si++) {
5443
- await parseSinglePage(targetPageNums[si]);
5451
+ for (let si = 0; si < targetPageNums.length; si++) {
5452
+ if (!sampledIndices.has(si)) {
5453
+ await parseSinglePage(targetPageNums[si]);
5454
+ }
5444
5455
  }
5445
5456
  }
5446
5457
  const parsedPageCount = parsedPages || (pageFilter ? pageFilter.size : effectivePageCount);
@@ -5449,7 +5460,7 @@ async function parsePdfDocument(buffer, options) {
5449
5460
  const ocrMode = options?.ocrMode ?? "auto";
5450
5461
  if (!ocrProvider && ocrMode !== "off") {
5451
5462
  try {
5452
- const { resolveOcrProvider } = await import("./resolve-QA3VACUP.js");
5463
+ const { resolveOcrProvider } = await import("./resolve-UOAOPQ4H.js");
5453
5464
  const concurrency = options?.ocrConcurrency ?? 1;
5454
5465
  const batchSize = options?.ocrBatchSize;
5455
5466
  ocrProvider = await resolveOcrProvider(ocrMode, warnings, concurrency, batchSize);
@@ -9768,4 +9779,4 @@ export {
9768
9779
  cfb/cfb.js:
9769
9780
  (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
9770
9781
  */
9771
- //# sourceMappingURL=chunk-2GFJFTKS.js.map
9782
+ //# sourceMappingURL=chunk-UDFKY7CH.js.map