diff --git a/lib/path.js b/lib/path.js index 079177694dc65c..e9f3adec9ef394 100644 --- a/lib/path.js +++ b/lib/path.js @@ -608,13 +608,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)