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

Function operator

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

Source from the content-addressed store, hash-verified

132 * * `["Negate", 5]` -> `"Negate"`
133 */
134export function operator(
135 expr: MathJsonExpression | null | undefined
136): MathJsonSymbol {
137 if (Array.isArray(expr)) return expr[0];
138
139 if (expr === null || expr === undefined) return '';
140
141 if (isFunctionObject(expr)) return expr.fn[0];
142
143 return '';
144}
145
146/**
147 * Return the arguments of a function, or an empty array if not a function

Callers 15

serializeExpressionFunction · 0.90
serializeFunctionFunction · 0.90
serializeGenericFunctionFunction · 0.90
serializeOperatorFunction · 0.90
serializeBaseFormFunction · 0.90
serializeNumberFunction · 0.90
serializeFunctionFunction · 0.90
getFractionStyleFunction · 0.90
isSinglePowerDenominatorFunction · 0.90
trySerializeDotNotationFunction · 0.90
wrapMethod · 0.90
wrapShortMethod · 0.90

Calls 1

isFunctionObjectFunction · 0.85

Tested by

no test coverage detected