Skip to content

Commit 4c965bf

Browse files
committed
simplify regex
1 parent 185aa2b commit 4c965bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util/identifier.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
2727
splitPath[0] = path.win32.relative(context, splitPath[0]);
2828
if (!/^[a-zA-Z]:\\/.test(splitPath[0])) {
2929
splitPath[0] = splitPath[0].replace(/\\/g, "/");
30-
if (!/^(\.\.\/|[a-zA-Z]:\\)/.test(splitPath[0])) {
30+
if (!/^\.\.\//.test(splitPath[0])) {
3131
splitPath[0] = "./" + splitPath[0];
3232
}
3333
}
3434
return splitPath.join("?");
3535
} else if (/^\//.test(maybeAbsolutePath)) {
3636
const splitPath = maybeAbsolutePath.split("?", 2);
3737
splitPath[0] = path.posix.relative(context, splitPath[0]);
38-
if (!/^(\.\.\/|\/)/.test(splitPath[0])) {
38+
if (!/^\.\.\//.test(splitPath[0])) {
3939
splitPath[0] = "./" + splitPath[0];
4040
}
4141
return splitPath.join("?");

0 commit comments

Comments
 (0)