(input: string)
| 168 | // Turns windows URL string ('c:\\etc\\') into URL node expects ('c:/etc/') |
| 169 | // https://github.com/sindresorhus/slash |
| 170 | export function slash(input: string) { |
| 171 | const isExtendedLengthPath = /^\\\\\?\\/.test(input); |
| 172 | const hasNonAscii = /[^\u0000-\u0080]+/.test(input); |
| 173 | |
| 174 | if (isExtendedLengthPath || hasNonAscii) { |
| 175 | return input; |
| 176 | } |
| 177 | |
| 178 | return input.replace(/\\/g, '/'); |
| 179 | } |
no outgoing calls
no test coverage detected