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

Function stripText

src/math-json/utils.ts:110–124  ·  view source on GitHub ↗
(
  expr: MathJsonExpression | null | undefined
)

Source from the content-addressed store, hash-verified

108}
109
110/**
111 * The operator of a function is symbol.
112 *
113 * Return an empty string if the expression is not a function.
114 *
115 * Examples:
116 * * `["Negate", 5]` -> `"Negate"`
117 */
118export function operator(
119 expr: MathJsonExpression | null | undefined
120): MathJsonSymbol {
121 if (Array.isArray(expr)) return expr[0];
122
123 if (expr === null || expr === undefined) return '';
124
125 if (isFunctionObject(expr)) return expr.fn[0];
126
127 return '';

Callers 1

parseCasesEnvironmentFunction · 0.90

Calls 4

stringValueFunction · 0.85
operandsFunction · 0.85
operatorFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected