MCPcopy Create free account
hub / github.com/webpack/mini-css-extract-plugin / compileBooleanMatcher

Function compileBooleanMatcher

src/utils.js:467–480  ·  view source on GitHub ↗
(map)

Source from the content-addressed store, hash-verified

465 * @returns {boolean | ((value: string) => string)} true/false, when unconditionally true/false, or a template function to determine the value at runtime
466 */
467const compileBooleanMatcher = (map) => {
468 const positiveItems = Object.keys(map).filter((i) => map[i]);
469 const negativeItems = Object.keys(map).filter((i) => !map[i]);
470
471 if (positiveItems.length === 0) {
472 return false;
473 }
474
475 if (negativeItems.length === 0) {
476 return true;
477 }
478
479 return compileBooleanMatcherFromLists(positiveItems, negativeItems);
480};
481
482module.exports = {
483 ABSOLUTE_PUBLIC_PATH,

Callers 1

generateMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…