Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
const bufferContent = { default: '' };
/**
* The event emitting virtual renderer
*
* @type {Object}
*/
const renderer = createVirtualRenderer();
/**
* Requests an ASAP flush
*
* @type {Function}
*/
renderer.requestFlush = asap.requestFlush;
renderer.events.on('renderSheet', (id, rules, options) => {
buffer((css) => {
const ruleString = rulesToCSS(rules);
if (css.indexOf(ruleString) === -1) {
return css + ruleString;
}
return css;
}, options);
});
renderer.events.on('removeSheet', (id, rules, options) => {
buffer((css) => css.replace(rulesToCSS(rules), ''), options);
});
renderer.events.on('removeAll', () => {