(str)
| 142 | } |
| 143 | |
| 144 | export const clearString = function (str) { |
| 145 | if (!str) return '' |
| 146 | /* Replace forbidden symbols in string |
| 147 | */ |
| 148 | if (str.endsWith('.')) { |
| 149 | str = str.slice(0, -1) |
| 150 | } |
| 151 | return str |
| 152 | .replace(/ /g, '_') |
| 153 | .replace(/"/g, "'") |
| 154 | .replace(/\//g, '_') |
| 155 | .replace(/</g, '(') |
| 156 | .replace(/>/g, ')') |
| 157 | .replace(/:/g, '_') |
| 158 | .replace(/\\/g, '_') |
| 159 | .replace(/\|/g, '_') |
| 160 | .replace(/\?/g, '.') |
| 161 | .replace(/\*/g, '^') |
| 162 | .replace(/'/g, '') |
| 163 | } |
| 164 | |
| 165 | export const decodeUrl = function (url) { |
| 166 | /* Replace forbidden symbols in string |
no outgoing calls
no test coverage detected