fix some issues; migrate to bun'

This commit is contained in:
Moritz Jung 2024-04-11 22:30:55 +02:00
parent cf3d5c6d6f
commit 54293ac3a1
56 changed files with 1360 additions and 764 deletions

View file

@ -31,12 +31,12 @@ export abstract class MediaTypeModel {
abstract getTags(): string[];
toMetaDataObject(): object {
toMetaDataObject(): Record<string, unknown> {
return { ...this.getWithOutUserData(), ...this.userData, tags: this.getTags().join('/') };
}
getWithOutUserData(): object {
const copy = Object.assign({}, this);
getWithOutUserData(): Record<string, unknown> {
const copy = structuredClone(this) as Record<string, unknown>;
delete copy.userData;
return copy;
}

View file

@ -17,7 +17,7 @@ export class WikiModel extends MediaTypeModel {
length: number;
article: string;
userData: {};
userData: Record<string, unknown>;
constructor(obj: any = {}) {
super();
@ -45,8 +45,8 @@ export class WikiModel extends MediaTypeModel {
return MediaType.Wiki;
}
override getWithOutUserData(): object {
const copy = Object.assign({}, this);
override getWithOutUserData(): Record<string, unknown> {
const copy = structuredClone(this) as Record<string, unknown>;
delete copy.userData;
delete copy.article;
return copy;