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

Function hasOperator

src/compute-engine/symbolic/fu-transforms.ts:43–47  ·  view source on GitHub ↗
(expr: Expression, ...ops: string[])

Source from the content-addressed store, hash-verified

41 * Check if expression contains specific operators anywhere in the tree
42 */
43export function hasOperator(expr: Expression, ...ops: string[]): boolean {
44 if (ops.includes(expr.operator)) return true;
45 if (!isFunction(expr)) return false;
46 return expr.ops.some((x) => hasOperator(x, ...ops));
47}
48
49/**
50 * Apply a transformation function to all subexpressions (bottom-up)

Callers 2

fu.test.tsFile · 0.90
fuFunction · 0.90

Calls 1

isFunctionFunction · 0.90

Tested by

no test coverage detected