fix: use OS-independent abs. path check (#8505)

This commit is contained in:
jrandolf
2022-06-10 14:34:57 +02:00
committed by GitHub
parent 8dbb4f3153
commit bfd4e68f25

View File

@@ -846,7 +846,7 @@ export class ElementHandle<
throw error;
}
const files = filePaths.map((filePath) => {
if (path.isAbsolute(filePath)) {
if (path.win32.isAbsolute(filePath) || path.posix.isAbsolute(filePath)) {
return filePath;
} else {
return path.resolve(filePath);