(ch)
| 47 | } |
| 48 | |
| 49 | function escapeIndexChar(ch) { |
| 50 | switch (ch) { |
| 51 | case "~": return "\\textasciitilde " |
| 52 | case "^": return "\\textasciicircum " |
| 53 | case "\\": return "\\textbackslash " |
| 54 | case "|": return "\\textbar{} " |
| 55 | case "@": return "\"@" |
| 56 | case "!": return "\"!" |
| 57 | case "- ": return "-@− " |
| 58 | case "--": return "--@−−" |
| 59 | case "-=": return "-=@−=" |
| 60 | default: return "\\" + ch |
| 61 | } |
| 62 | } |
| 63 | function escapeIndex(value) { |
| 64 | if (Array.isArray(value)) return value.map(escapeIndex).join("!") |
| 65 | return String(value).replace(/[&%$#_{}~^\\|!@]|-[ -=]/g, escapeIndexChar) |
nothing calls this directly
no outgoing calls
no test coverage detected