refactor: word

This commit is contained in:
Methapon2001 2023-11-27 14:11:27 +07:00
parent d8cf568206
commit 3820a05704
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
12 changed files with 56 additions and 56 deletions

View file

@ -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(