mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-01-16 23:00:51 +00:00
refactor(code-repository,local-file): normalize arrow return style and reformat sanitizeFilePath/readDirectory signatures
This commit is contained in:
parent
2781bf0583
commit
da21cfc1ff
2 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue