From 2db6defc0b555d93d2363ba6c6dfa19df7dc7c11 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 16:27:06 +0800 Subject: update --- node_modules/slash/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'node_modules/slash/index.js') diff --git a/node_modules/slash/index.js b/node_modules/slash/index.js index 1b7ee1ed..75d72501 100644 --- a/node_modules/slash/index.js +++ b/node_modules/slash/index.js @@ -1,9 +1,11 @@ -export default function slash(path) { - const isExtendedLengthPath = path.startsWith('\\\\?\\'); +'use strict'; +module.exports = input => { + const isExtendedLengthPath = /^\\\\\?\\/.test(input); + const hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex - if (isExtendedLengthPath) { - return path; + if (isExtendedLengthPath || hasNonAscii) { + return input; } - return path.replace(/\\/g, '/'); -} + return input.replace(/\\/g, '/'); +}; -- cgit v1.2.3