index.js 244 B

1234567891011
  1. 'use strict';
  2. module.exports = function (str) {
  3. var isExtendedLengthPath = /^\\\\\?\\/.test(str);
  4. var hasNonAscii = /[^\x00-\x80]+/.test(str);
  5. if (isExtendedLengthPath || hasNonAscii) {
  6. return str;
  7. }
  8. return str.replace(/\\/g, '/');
  9. };