Skip to content

Commit

Permalink
fix: getFileExtension to accept a trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
damanV5 committed Feb 19, 2025
1 parent 8842d37 commit b2fa11e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const getAbsoluteURL = function(url) {
*/
export const getFileExtension = function(path) {
if (typeof path === 'string') {
const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.*([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
const pathParts = splitPathRe.exec(path);

if (pathParts) {
Expand Down

0 comments on commit b2fa11e

Please sign in to comment.