refactor(code-repository,local-file): normalize arrow return style and reformat sanitizeFilePath/readDirectory signatures

This commit is contained in:
Nawaz Dhandala 2025-10-27 17:53:18 +00:00
parent 2781bf0583
commit da21cfc1ff
No known key found for this signature in database
GPG key ID: 96C5DCA24769DBCA
2 changed files with 7 additions and 7 deletions

View file

@ -317,7 +317,9 @@ export default class CodeRepositoryUtil {
const entries = await LocalFile.readDirectory(totalPath);
return entries.map((entry) => entry.name);
return entries.map((entry) => {
return entry.name;
});
}
@CaptureSpan()
@ -440,9 +442,9 @@ export default class CodeRepositoryUtil {
targetPath: string,
): string {
const root: string = path.resolve(repoPath);
const sanitizedTarget: string = LocalFile.sanitizeFilePath(targetPath).replace(
/^\/+/, "",
);
const sanitizedTarget: string = LocalFile.sanitizeFilePath(
targetPath,
).replace(/^\/+/, "");
const absoluteTarget: string = path.resolve(root, sanitizedTarget);
if (

View file

@ -90,9 +90,7 @@ export default class LocalFile {
}
@CaptureSpan()
public static async readDirectory(
path: string,
): Promise<Array<fs.Dirent>> {
public static async readDirectory(path: string): Promise<Array<fs.Dirent>> {
return new Promise(
(
resolve: (entries: Array<fs.Dirent>) => void,