Don't execute unnecessary HTTP requests when browing a file directory

This commit is contained in:
Dane Everitt
2020-04-10 13:57:24 -07:00
parent 76300209f1
commit b72a770ec9
6 changed files with 17 additions and 19 deletions

View File

@@ -11,3 +11,5 @@ export function bytesToHuman (bytes: number): string {
export const bytesToMegabytes = (bytes: number) => Math.floor(bytes / 1000 / 1000);
export const randomInt = (low: number, high: number) => Math.floor(Math.random() * (high - low) + low);
export const cleanDirectoryPath = (path: string) => path.replace(/(^#\/*)|(\/(\/*))|(^$)/g, '/');