@tiny-css/compiler
Version:
The compiler for compiling & reducing the bundle size of tiny-css
16 lines (15 loc) • 670 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterWithClassnames = void 0;
/**
* @description Filters tiny-css classes by default. But can also filter any provided css
* classObj.
* @author KR Tirtho
* @param {string[]} classnames
* @param {object} [globalClassnames=tinyCssClasses]
* @return {*} {string[]}
*/
function filterWithClassnames(classnames, globalClassnames) {
return classnames.filter(function (classname) { return (globalClassnames instanceof Object ? Object.values(globalClassnames) : globalClassnames).includes("." + classname); });
}
exports.filterWithClassnames = filterWithClassnames;