@lovebowls/leagueelements
Version:
League Elements package for LoveBowls
23 lines (21 loc) • 517 B
JavaScript
/**
* Base class for all league elements
*/
class BaseLeagueElement {
constructor(config) {
this.id = config.id ?? crypto.randomUUID();
this.type = config.type;
this.createdAt = new Date();
this.updatedAt = new Date();
}
/**
* Updates the element's data
* @param data - The data to update
*/
update(data) {
Object.assign(this, data);
this.updatedAt = new Date();
}
}
export { BaseLeagueElement };
//# sourceMappingURL=index.js.map