Skip to content

Commit

Permalink
fix: stricter extension check
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 4, 2023
1 parent 8ed1660 commit f5f508a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export function trimExtension(
extensions: ResolvedOptions['extensions']
) {
for (const extension of extensions) {
const lastDot = path.lastIndexOf(extension)
if (lastDot > -1) {
const lastDot = path.endsWith(extension) ? -extension.length : 0
if (lastDot < 0) {
// usually only one extension should match
return path.slice(0, lastDot)
}
Expand Down

0 comments on commit f5f508a

Please sign in to comment.