MCPcopy
hub / github.com/webpack/webpack / hasAtom

Function hasAtom

lib/dependencies/HarmonyImportGuard.js:104–117  ·  view source on GitHub ↗
(formula)

Source from the content-addressed store, hash-verified

102 * @returns {boolean} true when the formula contains at least one atom
103 */
104const hasAtom = (formula) => {
105 switch (formula[0]) {
106 case "v":
107 return true;
108 case "!":
109 return hasAtom(formula[1]);
110 case "&&":
111 case "||":
112 case "??":
113 return hasAtom(formula[1]) || hasAtom(formula[2]);
114 default:
115 return false;
116 }
117};
118
119/**
120 * @param {GuardFormula} formula formula

Callers 1

buildGuardFormulaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected