diff --git a/lib/path.js b/lib/path.js index f3e5a3b3416c4b..21bed936cadf70 100644 --- a/lib/path.js +++ b/lib/path.js @@ -617,13 +617,9 @@ const win32 = { */ toNamespacedPath(path) { // Note: this will *probably* throw somewhere. - if (typeof path !== 'string') + if (typeof path !== 'string' || path.length === 0) return path; - if (path.length === 0) { - return ''; - } - const resolvedPath = win32.resolve(path); if (resolvedPath.length <= 2)