Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update index.js
Fixed the bug of determining whether it is a path under non-windows platforms.
  • Loading branch information
shenlanchenwei authored Sep 25, 2023
commit a68b58df04d23de251f940cab13ee03ee10ed417
6 changes: 3 additions & 3 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const common_functions = {
isPathRelative(path) {
if(typeof path !== 'string') return false;
let isAbsolute = /^([A-Za-z]:|\.)/.test(path);

return isAbsolute;
const isLinuxPath = /^\//.test(path);
return isAbsolute||isLinuxPath;
},

/**
Expand Down Expand Up @@ -108,4 +108,4 @@ const common_functions = {
}
}

export { common_functions }
export { common_functions }