@seljs/checker 1.3.0-beta.17 → 1.3.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,19 @@ const registerIntegerOperators = (env) => {
54
54
  if (divisor === 0n) throw new Error("modulo by zero");
55
55
  return toSolInt((0, _seljs_types.toBigInt)(a) % divisor);
56
56
  });
57
+ tryRegisterOperator(env, "int + sol_int: sol_int", (a, b) => toSolInt((0, _seljs_types.toBigInt)(a) + (0, _seljs_types.toBigInt)(b)));
58
+ tryRegisterOperator(env, "int - sol_int: sol_int", (a, b) => toSolInt((0, _seljs_types.toBigInt)(a) - (0, _seljs_types.toBigInt)(b)));
59
+ tryRegisterOperator(env, "int * sol_int: sol_int", (a, b) => toSolInt((0, _seljs_types.toBigInt)(a) * (0, _seljs_types.toBigInt)(b)));
60
+ tryRegisterOperator(env, "int / sol_int: sol_int", (a, b) => {
61
+ const divisor = (0, _seljs_types.toBigInt)(b);
62
+ if (divisor === 0n) throw new Error("division by zero");
63
+ return toSolInt((0, _seljs_types.toBigInt)(a) / divisor);
64
+ });
65
+ tryRegisterOperator(env, "int % sol_int: sol_int", (a, b) => {
66
+ const divisor = (0, _seljs_types.toBigInt)(b);
67
+ if (divisor === 0n) throw new Error("modulo by zero");
68
+ return toSolInt((0, _seljs_types.toBigInt)(a) % divisor);
69
+ });
57
70
  tryRegisterOperator(env, "sol_int == int", (a, b) => (0, _seljs_types.toBigInt)(a) === (0, _seljs_types.toBigInt)(b));
58
71
  tryRegisterOperator(env, "int == sol_int", (a, b) => (0, _seljs_types.toBigInt)(a) === (0, _seljs_types.toBigInt)(b));
59
72
  tryRegisterOperator(env, "sol_int < int", (a, b) => (0, _seljs_types.toBigInt)(a) < (0, _seljs_types.toBigInt)(b));
@@ -53,6 +53,19 @@ const registerIntegerOperators = (env) => {
53
53
  if (divisor === 0n) throw new Error("modulo by zero");
54
54
  return toSolInt(toBigInt(a) % divisor);
55
55
  });
56
+ tryRegisterOperator(env, "int + sol_int: sol_int", (a, b) => toSolInt(toBigInt(a) + toBigInt(b)));
57
+ tryRegisterOperator(env, "int - sol_int: sol_int", (a, b) => toSolInt(toBigInt(a) - toBigInt(b)));
58
+ tryRegisterOperator(env, "int * sol_int: sol_int", (a, b) => toSolInt(toBigInt(a) * toBigInt(b)));
59
+ tryRegisterOperator(env, "int / sol_int: sol_int", (a, b) => {
60
+ const divisor = toBigInt(b);
61
+ if (divisor === 0n) throw new Error("division by zero");
62
+ return toSolInt(toBigInt(a) / divisor);
63
+ });
64
+ tryRegisterOperator(env, "int % sol_int: sol_int", (a, b) => {
65
+ const divisor = toBigInt(b);
66
+ if (divisor === 0n) throw new Error("modulo by zero");
67
+ return toSolInt(toBigInt(a) % divisor);
68
+ });
56
69
  tryRegisterOperator(env, "sol_int == int", (a, b) => toBigInt(a) === toBigInt(b));
57
70
  tryRegisterOperator(env, "int == sol_int", (a, b) => toBigInt(a) === toBigInt(b));
58
71
  tryRegisterOperator(env, "sol_int < int", (a, b) => toBigInt(a) < toBigInt(b));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seljs/checker",
3
- "version": "1.3.0-beta.17",
3
+ "version": "1.3.0-beta.18",
4
4
  "repository": {
5
5
  "url": "https://github.com/abinnovision/seljs"
6
6
  },
@@ -50,9 +50,9 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@marcbachmann/cel-js": "^7.5.3",
53
- "@seljs/common": "1.3.0-beta.17",
53
+ "@seljs/common": "1.3.0-beta.18",
54
54
  "@seljs/schema": "1.2.0",
55
- "@seljs/types": "1.3.0-beta.17",
55
+ "@seljs/types": "1.3.0-beta.18",
56
56
  "debug": "^4.4.3"
57
57
  },
58
58
  "devDependencies": {