refactor: word
This commit is contained in:
parent
d8cf568206
commit
3820a05704
12 changed files with 56 additions and 56 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { EhrFolder } from "../interfaces/ehr-fs";
|
||||
import { StorageFolder } from "../interfaces/storage-fs";
|
||||
import * as Minio from "minio";
|
||||
import minioClient from "../minio";
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ export async function pathExist(path: string): Promise<boolean> {
|
|||
* @param path - path to list
|
||||
* @return list of folder with metadata
|
||||
*/
|
||||
export async function listFolder(bucket: string, path?: string): Promise<EhrFolder[]> {
|
||||
export async function listFolder(bucket: string, path?: string): Promise<StorageFolder[]> {
|
||||
if (path) path = `${path.replace(/^\/|\/$/g, "")}/`;
|
||||
|
||||
const list = await new Promise<{ pathname: string; name: string }[]>((resolve, reject) => {
|
||||
|
|
@ -63,11 +63,11 @@ export async function listFolder(bucket: string, path?: string): Promise<EhrFold
|
|||
...v,
|
||||
createdAt: createdat ?? "n/a",
|
||||
createdBy: createdby ?? "n/a",
|
||||
} satisfies EhrFolder;
|
||||
} satisfies StorageFolder;
|
||||
}),
|
||||
);
|
||||
|
||||
return folder.filter((v: (typeof folder)[number]): v is EhrFolder => !!v);
|
||||
return folder.filter((v: (typeof folder)[number]): v is StorageFolder => !!v);
|
||||
}
|
||||
|
||||
export async function listItem(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue