@@ -38,23 +38,21 @@ export function escapeString(rawValue: any, options: EscapeOptions = {}) {
38
38
return [ ...stringValue ]
39
39
. map ( c => {
40
40
if ( c === '\b' ) {
41
- return `${ escapeChar } b` ;
41
+ return `${ escapeChar } b` ;
42
42
} else if ( c === '\t' ) {
43
- return `${ escapeChar } t` ;
43
+ return `${ escapeChar } t` ;
44
44
} else if ( c === '\n' ) {
45
45
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
50
49
} else if ( c === '\f' ) {
51
- return `${ escapeChar } f` ;
50
+ return `${ escapeChar } f` ;
52
51
} else if ( c === '\r' ) {
53
52
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
58
56
} else if ( c === escapeChar ) {
59
57
return escapeChar + escapeChar ;
60
58
} else if ( c === delimiter ) {
@@ -65,9 +63,8 @@ export function escapeString(rawValue: any, options: EscapeOptions = {}) {
65
63
// using this primarily for header values that are generally (though not 100%
66
64
// strictly?) ASCII-only, this should almost never happen.
67
65
return JSON . stringify ( c ) . slice ( 1 , - 1 ) ;
68
- }
69
- return c ;
70
-
66
+ }
67
+ return c ;
71
68
} )
72
69
. join ( '' ) ;
73
70
}
0 commit comments