MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / shouldFlatten

Function shouldFlatten

src/compute-engine/boxed-expression/flatten.ts:29–32  ·  view source on GitHub ↗
(x: Expression)

Source from the content-addressed store, hash-verified

27
28 if (operator) {
29 const shouldFlatten = (x: Expression) =>
30 isSymbol(x, 'Nothing') ||
31 x.operator === operator ||
32 x.operator === 'Sequence';
33
34 // Bypass memory allocation for the common case where there is nothing to flatten
35 if (xs.every((x) => !shouldFlatten(x))) return xs as T;

Callers 1

flattenFunction · 0.85

Calls 1

isSymbolFunction · 0.90

Tested by

no test coverage detected