mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor(code-repository,local-file): normalize arrow return style and reformat sanitizeFilePath/readDirectory signatures
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user