Skip to content

Commit 6f8d670

Browse files
committed
some simple tidy up
1 parent 275d0f0 commit 6f8d670

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/bundler-plugin-core/src/utils/normalizePath.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ export const normalizePath = (path: string, format: string): string => {
2828
leadingDelimiter,
2929
)})`;
3030

31+
const closingBracketIndex = format.slice(match.hashIndex).indexOf("]");
3132
// grab the ending delimiter and create a regex group for it
32-
let endingDelimiter = "";
33-
34-
endingDelimiter =
35-
format.at(
36-
match.hashIndex + format.slice(match.hashIndex).indexOf("]") + 1,
37-
) ?? "";
33+
let endingDelimiter =
34+
format.at(match.hashIndex + closingBracketIndex + 1) ?? "";
3835

3936
// If the ending delimiter is `[extname]` there won't be a
4037
// `.<file-extension>` so we need to replace it with a `.` for the

0 commit comments

Comments
 (0)