refactor(urlSigner): Improve file search logic for getFileUrlsWithSign function

This commit is contained in:
Peifan Li
2025-12-22 23:05:21 -05:00
parent e2991f94b0
commit fd97f20d1e
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,11 @@
# Change Log
## v1.6.35 (2025-12-22)
### Refactor
- refactor: Improve file search logic for getFileUrlsWithSign function (e2991f9)
## v1.6.34 (2025-12-22)
### Feat

View File

@@ -54,7 +54,7 @@ async function getFileUrlsWithSign(
const cleanPath = fullRelativePath.startsWith("/")
? fullRelativePath.substring(1)
: fullRelativePath;
const dirName = path.dirname(cleanPath);
const fileName = path.basename(cleanPath);
@@ -66,7 +66,9 @@ async function getFileUrlsWithSign(
try {
const files = await getFileList(config, searchPath);
// Check current directory
let foundFile = files.find((f: any) => f.name === fileName && !f.is_dir);
let foundFile = files.find(
(f: any) => f.name === fileName && !f.is_dir
);
if (foundFile) {
return foundFile;
}