@lovebowls/leagueelements
Version:
League Elements package for LoveBowls
25 lines (22 loc) • 550 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();
}
}
exports.BaseLeagueElement = BaseLeagueElement;
//# sourceMappingURL=index.cjs.map