MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / applyOperator

Function applyOperator

src/math.test.ts:19–30  ·  view source on GitHub ↗
(a: number, b: number, operator: Operator)

Source from the content-addressed store, hash-verified

17 }
18
19 function applyOperator(a: number, b: number, operator: Operator): number {
20 switch (operator) {
21 case '+':
22 return a + b;
23 case '-':
24 return a - b;
25 case '*':
26 return a * b;
27 case '/':
28 return a / b;
29 }
30 }
31
32 function* MathExpression(): ParseGenerator {
33 yield whitespaceMay;

Callers 1

MathExpressionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected