Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async function(s, t) {
const r = new purgecss.PurgeCSS(),
o = { ...purgecss.defaultOptions, ...e };
r.options = o;
const { content: c, extractors: n } = o,
u = c.filter(e => "string" == typeof e),
p = c.filter(e => "object" == typeof e),
i = await r.extractSelectorsFromFiles(u, n),
l = r.extractSelectorsFromString(p, n),
g = purgecss.mergeExtractorSelectors(i, l);
r.walkThroughCSS(s, g),
r.options.fontFace && r.removeUnusedFontFaces(),
r.options.keyframes && r.removeUnusedKeyframes(),
r.options.rejected &&
r.selectorsRemoved.size > 0 &&
(t.messages.push({
type: "purgecss",
plugin: "postcss-purgecss",
text: `purging ${