@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.js CHANGED
@@ -30870,15 +30870,17 @@ async function dcm2json(inputPath, options) {
30870
30870
  }
30871
30871
  const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
30872
30872
  const signal = options?.signal;
30873
+ const startTime = Date.now();
30874
+ const remaining = () => Math.max(1e3, timeoutMs - (Date.now() - startTime));
30873
30875
  const verbosity = options?.verbosity;
30874
30876
  if (options?.directOnly === true) {
30875
- return tryDirectPath(inputPath, timeoutMs, signal, verbosity);
30877
+ return tryDirectPath(inputPath, remaining(), signal, verbosity);
30876
30878
  }
30877
- const xmlResult = await tryXmlPath(inputPath, timeoutMs, signal, buildXmlOpts(options));
30879
+ const xmlResult = await tryXmlPath(inputPath, remaining(), signal, buildXmlOpts(options));
30878
30880
  if (xmlResult.ok) {
30879
30881
  return xmlResult;
30880
30882
  }
30881
- return tryDirectPath(inputPath, timeoutMs, signal, verbosity);
30883
+ return tryDirectPath(inputPath, remaining(), signal, verbosity);
30882
30884
  }
30883
30885
  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+\])?$/;
30884
30886
  var TagModificationSchema = z.object({