Skip to content

Commit 753d9cb

Browse files
committed
fixed regex
1 parent a7f3775 commit 753d9cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ const common_functions = {
5555
* @returns
5656
*/
5757
isPathRelative(path) {
58-
if(typeof path !== 'string') return false
59-
let isAbsolute = /^([a-zA-Z]\:|\\\\[^\/\\:*?"<>|]+\\[^\/\\:*?"<>|]+)(\\[^\/\\:*?"<>|]+)+(\.[^\/\\:*?"<>|]+)$/.test(path);
58+
if(typeof path !== 'string') return false;
59+
let isAbsolute = /^([A-Za-z]:|\.)/.test(path);
6060

61-
return !isAbsolute;
61+
return isAbsolute;
6262
},
6363

6464
/**

0 commit comments

Comments
 (0)