123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- "use strict";
- exports.__esModule = true;
- function binaryOperation(operator, left, right) {
- switch (operator) {
- case '+':
- return left + right;
- case '-':
- return left - right;
- case '/':
- return left / right;
- case '%':
- return left % right;
- case '*':
- return left * right;
- case '**':
- return Math.pow(left, right);
- case '&':
- return left & right;
- case '|':
- return left | right;
- case '>>':
- return left >> right;
- case '>>>':
- return left >>> right;
- case '<<':
- return left << right;
- case '^':
- return left ^ right;
- case '==':
- return left == right;
- case '===':
- return left === right;
- case '!=':
- return left != right;
- case '!==':
- return left !== right;
- case 'in':
- return left in right;
- case 'instanceof':
- return left instanceof right;
- case '>':
- return left > right;
- case '<':
- return left < right;
- case '>=':
- return left >= right;
- case '<=':
- return left <= right;
- }
- }
- exports["default"] = binaryOperation;
|