@ubercode/dcmtk 0.13.2 → 0.14.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/dicom.cjs CHANGED
@@ -30876,15 +30876,17 @@ async function dcm2json(inputPath, options) {
30876
30876
  }
30877
30877
  const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
30878
30878
  const signal = options?.signal;
30879
+ const startTime = Date.now();
30880
+ const remaining = () => Math.max(1e3, timeoutMs - (Date.now() - startTime));
30879
30881
  const verbosity = options?.verbosity;
30880
30882
  if (options?.directOnly === true) {
30881
- return tryDirectPath(inputPath, timeoutMs, signal, verbosity);
30883
+ return tryDirectPath(inputPath, remaining(), signal, verbosity);
30882
30884
  }
30883
- const xmlResult = await tryXmlPath(inputPath, timeoutMs, signal, buildXmlOpts(options));
30885
+ const xmlResult = await tryXmlPath(inputPath, remaining(), signal, buildXmlOpts(options));
30884
30886
  if (xmlResult.ok) {
30885
30887
  return xmlResult;
30886
30888
  }
30887
- return tryDirectPath(inputPath, timeoutMs, signal, verbosity);
30889
+ return tryDirectPath(inputPath, remaining(), signal, verbosity);
30888
30890
  }
30889
30891
  var TAG_OR_PATH_PATTERN = /^\([0-9A-Fa-f]{4},[0-9A-Fa-f]{4}\)(\[\d+\]\.\([0-9A-Fa-f]{4},[0-9A-Fa-f]{4}\))*(\[\d+\])?$/;
30890
30892
  var TagModificationSchema = zod.z.object({