blob: b946a0841a01f4886706f0046d86fcf4f14a9184 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001'use strict';
2module.exports = function (str) {
3 var isExtendedLengthPath = /^\\\\\?\\/.test(str);
4 var hasNonAscii = /[^\x00-\x80]+/.test(str);
5
6 if (isExtendedLengthPath || hasNonAscii) {
7 return str;
8 }
9
10 return str.replace(/\\/g, '/');
11};