Skip to content

Commit

Permalink
Merge pull request #14 from sylvainDNS/main
Browse files Browse the repository at this point in the history
fix: remove leading slash in sublfolder path
  • Loading branch information
JannikZed authored Nov 21, 2023
2 parents 57bca82 + 40ddf0b commit 8e9fd80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ function assertUrlProtocol(url) {
// },
// },

function removeLeadingSlash(str) {
return str.replace(/^\//, "");
}

function getPathKey(file) {
const filePath = file.path ? `${file.path}/` : "";
const path =
file.folderPath && file.folderPath !== "/"
? `${file.folderPath}/${filePath}`
? `${removeLeadingSlash(file.folderPath)}/${filePath}`
: filePath;

const Key = `${path}${file.hash}${file.ext}`;
Expand Down

0 comments on commit 8e9fd80

Please sign in to comment.