// retoor <retoor@molodetz.nl>
export class Component extends HTMLElement {
attr(name, fallback = "") {
const value = this.getAttribute(name);
return value === null ? fallback : value;
}
boolAttr(name) {
return this.hasAttribute(name);
}
intAttr(name, fallback = 0) {
const value = parseInt(this.getAttribute(name), 10);
return Number.isNaN(value) ? fallback : value;
}
}