added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -49,12 +49,12 @@ export class Storage implements EmitsEvents {
constructor(
adapter: StorageAdapter,
config: Partial<StorageConfig> = {},
emgr?: EventManager<any>
emgr?: EventManager<any>,
) {
this.#adapter = adapter;
this.config = {
...config,
body_max_size: config.body_max_size
body_max_size: config.body_max_size,
};
this.emgr = emgr ?? new EventManager();
@@ -78,7 +78,7 @@ export class Storage implements EmitsEvents {
async uploadFile(
file: FileBody,
name: string,
noEmit?: boolean
noEmit?: boolean,
): Promise<FileUploadedEventData> {
const result = await this.#adapter.putObject(name, file);
if (typeof result === "undefined") {
@@ -89,9 +89,9 @@ export class Storage implements EmitsEvents {
name,
meta: {
size: 0,
type: "application/octet-stream"
type: "application/octet-stream",
},
etag: typeof result === "string" ? result : ""
etag: typeof result === "string" ? result : "",
};
if (typeof result === "object") {
@@ -115,8 +115,8 @@ export class Storage implements EmitsEvents {
...info,
state: {
name: info.name,
path: info.name
}
path: info.name,
},
};
if (!noEmit) {
const result = await this.emgr.emit(new StorageEvents.FileUploadedEvent(eventData));