We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cf1fa3 commit 9e3a8bbCopy full SHA for 9e3a8bb
1 file changed
src/utils.ts
@@ -27,7 +27,7 @@ export function decodeLine(line: string): string {
27
}
28
29
export function encodeLine(line: string, isKey?: boolean): string {
30
- line = line.replace(isKey ? ENCODE_KEY_PATTERN : ENCODE_PATTERN, (c) => {
+ let str = line.replace(isKey ? ENCODE_KEY_PATTERN : ENCODE_PATTERN, (c) => {
31
if (c === '\t') {
32
return '\\t';
33
} else if (c === '\r') {
@@ -47,12 +47,12 @@ export function encodeLine(line: string, isKey?: boolean): string {
47
48
});
49
if (!isKey) {
50
- const c = line.charAt(0);
+ const c = str.charAt(0);
51
if (c === ' ' || c === '\t' || c === '\f') {
52
- line = '\\' + line;
+ str = '\\' + str;
53
54
55
- return line;
+ return str;
56
57
58
/**
0 commit comments