@@ -170,7 +170,6 @@ class ValueRepresentation {
170170 return values ;
171171 }
172172
173-
174173 read ( stream , length , syntax , readOptions = { forceStoreRaw : false } ) {
175174 if ( this . fixed && this . maxLength ) {
176175 if ( ! length ) return this . defaultValue ;
@@ -639,14 +638,16 @@ class CodeString extends AsciiStringRepresentation {
639638
640639 readBytes ( stream , length ) {
641640 const BACKSLASH = String . fromCharCode ( VM_DELIMITER ) ;
642- return this . dropPadByte ( stream . readAsciiString ( length ) . split ( BACKSLASH ) ) ;
641+ return this . dropPadByte (
642+ stream . readAsciiString ( length ) . split ( BACKSLASH )
643+ ) ;
643644 }
644645
645646 applyFormatting ( value ) {
646- const trim = ( str ) => str . trim ( ) ;
647+ const trim = str => str . trim ( ) ;
647648
648649 if ( Array . isArray ( value ) ) {
649- return value . map ( ( str ) => trim ( str ) ) ;
650+ return value . map ( str => trim ( str ) ) ;
650651 }
651652
652653 return trim ( value ) ;
@@ -697,7 +698,6 @@ class DateValue extends AsciiStringRepresentation {
697698}
698699
699700class NumericStringRepresentation extends AsciiStringRepresentation {
700-
701701 readBytes ( stream , length ) {
702702 const BACKSLASH = String . fromCharCode ( VM_DELIMITER ) ;
703703 const numStr = stream . readAsciiString ( length ) ;
@@ -714,10 +714,10 @@ class DecimalString extends NumericStringRepresentation {
714714 }
715715
716716 applyFormatting ( value ) {
717- const formatNumber = ( numberStr ) => {
717+ const formatNumber = numberStr => {
718718 let returnVal = numberStr . trim ( ) . replace ( / [ ^ 0 - 9 . \\ \- + e ] / gi, "" ) ;
719719 return returnVal === "" ? null : Number ( returnVal ) ;
720- }
720+ } ;
721721
722722 if ( Array . isArray ( value ) ) {
723723 return value . map ( formatNumber ) ;
@@ -728,7 +728,7 @@ class DecimalString extends NumericStringRepresentation {
728728
729729 convertToString ( value ) {
730730 if ( value === null ) return "" ;
731- if ( typeof value === ' string' ) return value ;
731+ if ( typeof value === " string" ) return value ;
732732
733733 let str = String ( value ) ;
734734 if ( str . length > this . maxLength ) {
@@ -841,10 +841,10 @@ class IntegerString extends NumericStringRepresentation {
841841 }
842842
843843 applyFormatting ( value ) {
844- const formatNumber = ( numberStr ) => {
844+ const formatNumber = numberStr => {
845845 let returnVal = numberStr . trim ( ) . replace ( / [ ^ 0 - 9 . \\ \- + e ] / gi, "" ) ;
846846 return returnVal === "" ? null : Number ( returnVal ) ;
847- }
847+ } ;
848848
849849 if ( Array . isArray ( value ) ) {
850850 return value . map ( formatNumber ) ;
@@ -854,7 +854,7 @@ class IntegerString extends NumericStringRepresentation {
854854 }
855855
856856 convertToString ( value ) {
857- if ( typeof value === ' string' ) return value ;
857+ if ( typeof value === " string" ) return value ;
858858 return value === null ? "" : String ( value ) ;
859859 }
860860
@@ -967,14 +967,17 @@ class PersonName extends EncodedStringRepresentation {
967967 }
968968
969969 readBytes ( stream , length ) {
970- return this . readPaddedEncodedString ( stream , length ) . split ( String . fromCharCode ( VM_DELIMITER ) ) ;
970+ return this . readPaddedEncodedString ( stream , length ) . split (
971+ String . fromCharCode ( VM_DELIMITER )
972+ ) ;
971973 }
972974
973975 applyFormatting ( value ) {
974- const parsePersonName = ( valueStr ) => dicomJson . pnConvertToJsonObject ( valueStr , false ) ;
976+ const parsePersonName = valueStr =>
977+ dicomJson . pnConvertToJsonObject ( valueStr , false ) ;
975978
976979 if ( Array . isArray ( value ) ) {
977- return value . map ( ( valueStr ) => parsePersonName ( valueStr ) ) ;
980+ return value . map ( valueStr => parsePersonName ( valueStr ) ) ;
978981 }
979982
980983 return parsePersonName ( value ) ;
@@ -1321,16 +1324,16 @@ class UniqueIdentifier extends AsciiStringRepresentation {
13211324 // https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.4.html
13221325
13231326 if ( result . indexOf ( BACKSLASH ) === - 1 ) {
1324- return result
1327+ return result ;
13251328 } else {
13261329 return this . dropPadByte ( result . split ( BACKSLASH ) ) ;
13271330 }
13281331 }
13291332
13301333 applyFormatting ( value ) {
1331- const removeInvalidUidChars = ( uidStr ) => {
1334+ const removeInvalidUidChars = uidStr => {
13321335 return uidStr . replace ( / [ ^ 0 - 9 . ] / g, "" ) ;
1333- }
1336+ } ;
13341337
13351338 if ( Array . isArray ( value ) ) {
13361339 return value . map ( removeInvalidUidChars ) ;
@@ -1385,7 +1388,12 @@ class ParsedUnknownValue extends BinaryRepresentation {
13851388 i = 0 ;
13861389
13871390 while ( i ++ < times ) {
1388- const { rawValue, value } = vr . read ( streamFromBuffer , vr . maxLength , syntax , readOptions ) ;
1391+ const { rawValue, value } = vr . read (
1392+ streamFromBuffer ,
1393+ vr . maxLength ,
1394+ syntax ,
1395+ readOptions
1396+ ) ;
13891397 rawValues . push ( rawValue ) ;
13901398 values . push ( value ) ;
13911399 }
@@ -1466,4 +1474,4 @@ let VRinstances = {
14661474 UT : new UnlimitedText ( )
14671475} ;
14681476
1469- export { ValueRepresentation } ;
1477+ export { ValueRepresentation } ;
0 commit comments