@ubercode/dcmtk 0.9.4 → 0.10.1
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 +8 -7
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.js +8 -7
- package/dist/dicom.js.map +1 -1
- package/dist/{index-zdzuZTms.d.cts → index-CEqwLKgE.d.cts} +2 -4
- package/dist/{index-x98H349Q.d.ts → index-Hp4Ri9y5.d.ts} +2 -4
- package/dist/index.cjs +346 -292
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +333 -279
- package/dist/index.js.map +1 -1
- package/dist/retry-Aryrk1uP.d.ts +112 -0
- package/dist/retry-CJ60nZxE.d.cts +112 -0
- package/dist/servers.cjs +472 -420
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +1 -1
- package/dist/servers.d.ts +1 -1
- package/dist/servers.js +465 -413
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +8 -7
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.js +8 -7
- package/dist/tools.js.map +1 -1
- package/dist/utils.cjs +46 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +21 -94
- package/dist/utils.d.ts +21 -94
- package/dist/utils.js +43 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/dicom.js
CHANGED
|
@@ -30378,13 +30378,14 @@ async function execCommand(binary, args, options) {
|
|
|
30378
30378
|
windowsHide: true,
|
|
30379
30379
|
signal: options?.signal
|
|
30380
30380
|
});
|
|
30381
|
-
wireSpawnListeners(child, timeoutMs, resolve);
|
|
30381
|
+
wireSpawnListeners(binary, child, timeoutMs, resolve);
|
|
30382
30382
|
});
|
|
30383
30383
|
}
|
|
30384
|
-
function wireSpawnListeners(child, timeoutMs, resolve) {
|
|
30384
|
+
function wireSpawnListeners(binary, child, timeoutMs, resolve) {
|
|
30385
30385
|
let stdout = "";
|
|
30386
30386
|
let stderr4 = "";
|
|
30387
30387
|
let settled = false;
|
|
30388
|
+
const name = binary.split("/").pop() ?? binary;
|
|
30388
30389
|
const settle = (result) => {
|
|
30389
30390
|
if (settled) return;
|
|
30390
30391
|
settled = true;
|
|
@@ -30393,25 +30394,25 @@ function wireSpawnListeners(child, timeoutMs, resolve) {
|
|
|
30393
30394
|
};
|
|
30394
30395
|
const timer = setTimeout(() => {
|
|
30395
30396
|
if (child.pid !== void 0 && child.pid !== null) killTree(child.pid);
|
|
30396
|
-
settle(err(new Error(
|
|
30397
|
+
settle(err(new Error(`${name} timed out after ${timeoutMs}ms (pid: ${String(child.pid ?? "unknown")})`)));
|
|
30397
30398
|
}, timeoutMs);
|
|
30398
30399
|
child.stdout?.on("data", (chunk) => {
|
|
30399
30400
|
stdout += String(chunk);
|
|
30400
30401
|
if (stdout.length + stderr4.length > MAX_OUTPUT_BYTES) {
|
|
30401
30402
|
if (child.pid !== void 0 && child.pid !== null) killTree(child.pid);
|
|
30402
|
-
settle(err(new Error(
|
|
30403
|
+
settle(err(new Error(`${name} output exceeded ${MAX_OUTPUT_BYTES} bytes`)));
|
|
30403
30404
|
}
|
|
30404
30405
|
});
|
|
30405
30406
|
child.stderr?.on("data", (chunk) => {
|
|
30406
30407
|
stderr4 += String(chunk);
|
|
30407
30408
|
if (stdout.length + stderr4.length > MAX_OUTPUT_BYTES) {
|
|
30408
30409
|
if (child.pid !== void 0 && child.pid !== null) killTree(child.pid);
|
|
30409
|
-
settle(err(new Error(
|
|
30410
|
+
settle(err(new Error(`${name} output exceeded ${MAX_OUTPUT_BYTES} bytes`)));
|
|
30410
30411
|
}
|
|
30411
30412
|
});
|
|
30412
30413
|
child.on("error", (error) => {
|
|
30413
30414
|
if (child.pid !== void 0 && child.pid !== null) killTree(child.pid);
|
|
30414
|
-
settle(err(new Error(
|
|
30415
|
+
settle(err(new Error(`${name} error: ${error.message}`)));
|
|
30415
30416
|
});
|
|
30416
30417
|
child.on("close", (code) => {
|
|
30417
30418
|
settle(ok({ stdout, stderr: stderr4, exitCode: code ?? 1 }));
|
|
@@ -30426,7 +30427,7 @@ async function spawnCommand(binary, args, options) {
|
|
|
30426
30427
|
windowsHide: true,
|
|
30427
30428
|
signal: options?.signal
|
|
30428
30429
|
});
|
|
30429
|
-
wireSpawnListeners(child, timeoutMs, resolve);
|
|
30430
|
+
wireSpawnListeners(binary, child, timeoutMs, resolve);
|
|
30430
30431
|
});
|
|
30431
30432
|
}
|
|
30432
30433
|
var cachedPath;
|