fix(Base): data is optional (#225)

This commit is contained in:
Andrés 2024-07-27 18:21:38 +02:00 committed by GitHub
parent ca51b1f535
commit 97cd39eb10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ import type { APIBaseComponent, ComponentType } from '../types';
export abstract class BaseComponentBuilder<
TYPE extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>,
> {
constructor(public data: Partial<TYPE>) {}
constructor(public data: Partial<TYPE> = {}) {}
toJSON(): TYPE {
return { ...this.data } as TYPE;