(str)
| 40 | } |
| 41 | } |
| 42 | function escape(str) { |
| 43 | return String(str).replace(/[&%$#_{}~^\\"]|\w(\/)\w/g, (match, group) => { |
| 44 | if (group) return match[0] + escapeChar(group) + match[2] |
| 45 | return escapeChar(match) |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | function escapeIndexChar(ch) { |
| 50 | switch (ch) { |
no test coverage detected