Skip to content

Commit

Permalink
Properly escape the dot character in regexp (#4608)
Browse files Browse the repository at this point in the history
A follow-up to #4604: the dot in the regexp was not escaped as intended. By default `*` matches greedily, so the results are the same, but the new regexp should be more clear. Sorry for the mistake.
  • Loading branch information
fatfisz authored and timneutkens committed Jun 14, 2018
1 parent f2c2519 commit 8889430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readdirSync, existsSync } from 'fs'

export function getChunkNameFromFilename (filename, dev) {
if (dev) {
return filename.replace(/.[^.]*$/, '')
return filename.replace(/\.[^.]*$/, '')
}
return filename.replace(/-[^-]*$/, '')
}
Expand Down

0 comments on commit 8889430

Please sign in to comment.