export class BEM {
    data;
    parent;
    otherClass = [];
    constructor(parent, data = {}) {
        this.parent = parent;
        this.data = data;
    }
    append(className) { this.otherClass = [...this.otherClass, className]; }
    className(className, data = {}) {
        return Object.entries(data).reduce((prv, [key, value]) => {
            if (value) {
                return [...prv, key];
            }
            ;
            return prv;
        }, [className]).join(" ");
    }
    toString() {
        return Object.entries(this.data).reduce((prv, [key, value]) => {
            if (value) {
                return [...prv, key];
            }
            ;
            return prv;
        }, [this.parent, ...this.otherClass]).join(" ");
    }
}
