MCPcopy
hub / github.com/prettier/prettier / shouldInlineLogicalExpression

Function shouldInlineLogicalExpression

src/language-js/print/binaryish.js:363–381  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

361}
362
363function shouldInlineLogicalExpression(node) {
364 if (node.type !== "LogicalExpression") {
365 return false;
366 }
367
368 if (isObjectExpression(node.right) && node.right.properties.length > 0) {
369 return true;
370 }
371
372 if (isArrayExpression(node.right) && node.right.elements.length > 0) {
373 return true;
374 }
375
376 if (isJsxElement(node.right)) {
377 return true;
378 }
379
380 return false;
381}
382
383const isBitwiseOrExpression = (node) =>
384 node.type === "BinaryExpression" && node.operator === "|";

Callers 3

shouldBreakAfterOperatorFunction · 0.90
printBinaryishExpressionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…