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

Function nops

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

Source from the content-addressed store, hash-verified

169}
170
171export function nops(expr: MathJsonExpression | null | undefined): number {
172 if (expr === null || expr === undefined) return 0;
173 if (Array.isArray(expr)) return Math.max(0, expr.length - 1);
174 if (isFunctionObject(expr)) return Math.max(0, expr.fn.length - 1);
175 return 0;
176}
177
178export function unhold(
179 expr: MathJsonExpression | null

Callers 15

serializeCortexFunction · 0.90
serializeOperatorFunction · 0.90
wrapShortMethod · 0.90
numeratorDenominatorFunction · 0.90
serializeMultiplyFunction · 0.90
unwrapSingleItemListFunction · 0.90
serializeListFunction · 0.90
parseAssignFunction · 0.90
parseModulusAnnotationFunction · 0.90

Calls 1

isFunctionObjectFunction · 0.85

Tested by

no test coverage detected