@@ -38,23 +38,21 @@ export function escapeString(rawValue: any, options: EscapeOptions = {}) {
3838 return [ ...stringValue ]
3939 . map ( c => {
4040 if ( c === '\b' ) {
41- return `${ escapeChar } b` ;
41+ return `${ escapeChar } b` ;
4242 } else if ( c === '\t' ) {
43- return `${ escapeChar } t` ;
43+ return `${ escapeChar } t` ;
4444 } else if ( c === '\n' ) {
4545 if ( escapeNewlines ) {
46- return `${ escapeChar } n` ;
47- }
48- return c ; // Don't just continue, or this is caught by < \u0020
49-
46+ return `${ escapeChar } n` ;
47+ }
48+ return c ; // Don't just continue, or this is caught by < \u0020
5049 } else if ( c === '\f' ) {
51- return `${ escapeChar } f` ;
50+ return `${ escapeChar } f` ;
5251 } else if ( c === '\r' ) {
5352 if ( escapeNewlines ) {
54- return `${ escapeChar } r` ;
55- }
56- return c ; // Don't just continue, or this is caught by < \u0020
57-
53+ return `${ escapeChar } r` ;
54+ }
55+ return c ; // Don't just continue, or this is caught by < \u0020
5856 } else if ( c === escapeChar ) {
5957 return escapeChar + escapeChar ;
6058 } else if ( c === delimiter ) {
@@ -65,9 +63,8 @@ export function escapeString(rawValue: any, options: EscapeOptions = {}) {
6563 // using this primarily for header values that are generally (though not 100%
6664 // strictly?) ASCII-only, this should almost never happen.
6765 return JSON . stringify ( c ) . slice ( 1 , - 1 ) ;
68- }
69- return c ;
70-
66+ }
67+ return c ;
7168 } )
7269 . join ( '' ) ;
7370}
0 commit comments