@ubercode/dcmtk 0.15.0 → 0.15.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 +10 -4
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.js +10 -4
- package/dist/dicom.js.map +1 -1
- package/dist/index.cjs +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +10 -4
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.js +10 -4
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +10 -4
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.js +10 -4
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31265,8 +31265,14 @@ var KNOWN_VR_CODES = /* @__PURE__ */ new Set([
|
|
|
31265
31265
|
"UT",
|
|
31266
31266
|
"UV"
|
|
31267
31267
|
]);
|
|
31268
|
+
function decodeXmlEntities(value) {
|
|
31269
|
+
return value.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
31270
|
+
}
|
|
31271
|
+
function decodeIfString(value) {
|
|
31272
|
+
return typeof value === "string" ? decodeXmlEntities(value) : value;
|
|
31273
|
+
}
|
|
31268
31274
|
function buildPnString(comp) {
|
|
31269
|
-
const parts = [comp.FamilyName ?? "", comp.GivenName ?? "", comp.MiddleName ?? "", comp.NamePrefix ?? "", comp.NameSuffix ?? ""];
|
|
31275
|
+
const parts = [comp.FamilyName ?? "", comp.GivenName ?? "", comp.MiddleName ?? "", comp.NamePrefix ?? "", comp.NameSuffix ?? ""].map(decodeXmlEntities);
|
|
31270
31276
|
let last = parts.length - 1;
|
|
31271
31277
|
for (; last >= 0; last--) {
|
|
31272
31278
|
if (parts[last] !== "") break;
|
|
@@ -31305,9 +31311,9 @@ function convertBulkDataURI(attr, element) {
|
|
|
31305
31311
|
const bulkArray = toArray(attr.BulkDataURI);
|
|
31306
31312
|
const firstBulk = bulkArray[0];
|
|
31307
31313
|
if (typeof firstBulk === "object" && firstBulk !== null && "@_uri" in firstBulk) {
|
|
31308
|
-
element.BulkDataURI = safeString(firstBulk["@_uri"]);
|
|
31314
|
+
element.BulkDataURI = decodeXmlEntities(safeString(firstBulk["@_uri"]));
|
|
31309
31315
|
} else {
|
|
31310
|
-
element.BulkDataURI = safeString(firstBulk);
|
|
31316
|
+
element.BulkDataURI = decodeXmlEntities(safeString(firstBulk));
|
|
31311
31317
|
}
|
|
31312
31318
|
}
|
|
31313
31319
|
function convertPNValue(attr, element) {
|
|
@@ -31351,7 +31357,7 @@ function convertRegularValue(attr, element, vr) {
|
|
|
31351
31357
|
const values = [];
|
|
31352
31358
|
const isNumeric = NUMERIC_JSON_VRS.has(vr);
|
|
31353
31359
|
for (const v of valArray) {
|
|
31354
|
-
const unwrapped = unwrapValue(v);
|
|
31360
|
+
const unwrapped = decodeIfString(unwrapValue(v));
|
|
31355
31361
|
values.push(isNumeric ? coerceNumeric(unwrapped) : unwrapped);
|
|
31356
31362
|
}
|
|
31357
31363
|
if (values.length > 0) element.Value = values;
|