Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
multiValue: function(data, tag, parser) {
if (this.isValidDataSet(data) && tag in data.elements) {
let element = data.elements[tag];
if (element && element.length > 0) {
let string = dicomParser.readFixedString(
data.byteArray,
element.dataOffset,
element.length
);
if (typeof string === 'string' && string.length > 0) {
if (typeof parser !== 'function') {
parser = null;
}
return string.split('\\').map(function(value) {
value = value.trim();
return parser !== null ? parser(value) : value;
});
}
}
}