( expr: MathJsonExpression | null | undefined )
| 132 | * * `["Negate", 5]` -> `"Negate"` |
| 133 | */ |
| 134 | export 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 |
no test coverage detected