Skip to content

Commit

Permalink
fix: fix windows platform compatibility issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 21, 2023
1 parent 7c1dd4c commit 369ee03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/typescript/src/utils.ts
Expand Up @@ -11,7 +11,8 @@ export const __dirname = dirname(__filename);
* @param paths `[ 'src/index.jsx', 'test/sum.js' ]`
* @returns ['src', 'test']
*/
export const getRootsFolderName = (paths: string[] = []) => paths.map((item) => item.split(path.sep)[0]);
export const getRootsFolderName = (paths: string[] = []) =>
paths.map((item) => item.replace(/[/\\]/g, path.sep).split(path.sep)[0]);

const getLnCol = (text: string = '', pos: number = 0) => {
const lines = text.split('\n');
Expand Down

0 comments on commit 369ee03

Please sign in to comment.