1- import { helper } from "./xml-helper.module" ;
1+ import { Helper } from "./xml-helper.module" ;
22
33var currentElement : any , currentElementName : any ;
4- var h = new helper ( ) ;
4+ var h = new Helper ( ) ;
55
66function validateOptions ( userOptions : any ) {
77 var options = h . copyOptions ( userOptions ) ;
@@ -98,7 +98,9 @@ function writeInstruction(instruction: any, options: any, depth: any) {
9898 return '<?' + instructionName + writeAttributes ( instruction [ key ] [ options . attributesKey ] , options , depth ) + '?>' ;
9999 } else {
100100 var instructionValue = instruction [ key ] ? instruction [ key ] : '' ;
101- if ( 'instructionFn' in options ) instructionValue = options . instructionFn ( instructionValue , key , currentElementName , currentElement ) ;
101+ if ( 'instructionFn' in options ) {
102+ instructionValue = options . instructionFn ( instructionValue , key , currentElementName , currentElement ) ;
103+ }
102104 return '<?' + instructionName + ( instructionValue ? ' ' + instructionValue : '' ) + '?>' ;
103105 }
104106}
@@ -116,7 +118,9 @@ function writeDoctype(doctype: any, options: any) {
116118}
117119
118120function writeText ( text : any , options : any ) {
119- if ( options . ignoreText ) return '' ;
121+ if ( options . ignoreText ) {
122+ return '' ;
123+ }
120124 text = '' + text ; // ensure Number and Boolean are converted to String
121125 text = text . replace ( / & a m p ; / g, '&' ) ; // desanitize to avoid double sanitization
122126 text = text . replace ( / & / g, '&' ) . replace ( / < / g, '<' ) . replace ( / > / g, '>' ) ;
0 commit comments