| 86 | const QUOTED_VALUE_PATTERN = /^(?:([\\]$)|[\\][\s\S]|[^"])*(?:(")|$)/u; |
| 87 | |
| 88 | function removeBackslashes(str) { |
| 89 | let ret = ''; |
| 90 | // We stop at str.length - 1 because we want to look ahead one character. |
| 91 | let i; |
| 92 | for (i = 0; i < str.length - 1; i++) { |
| 93 | const c = str[i]; |
| 94 | if (c === '\\') { |
| 95 | i++; |
| 96 | ret += str[i]; |
| 97 | } else { |
| 98 | ret += c; |
| 99 | } |
| 100 | } |
| 101 | // We add the last character if we didn't skip to it. |
| 102 | if (i === str.length - 1) { |
| 103 | ret += str[i]; |
| 104 | } |
| 105 | return ret; |
| 106 | } |
| 107 | |
| 108 | |
| 109 | function escapeQuoteOrSolidus(str) { |