fix: code workspace path error

This commit is contained in:
vben
2024-06-02 22:13:15 +08:00
parent 30f7472d26
commit 6d4991d852
10 changed files with 86 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
import { posix } from 'node:path';
/**
* 将给定的文件路径转换为 POSIX 风格。
* @param {string} pathname - 原始文件路径。
*/
function toPosixPath(pathname: string) {
return pathname.split(`\\`).join(posix.sep);
}
export { toPosixPath };