@mtcute/core 0.29.1 → 0.29.4

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.
@@ -226,7 +226,7 @@ class NetworkManager {
226
226
  _: "initConnection",
227
227
  deviceModel,
228
228
  systemVersion: "1.0",
229
- appVersion: "0.29.1",
229
+ appVersion: "0.29.4",
230
230
  systemLangCode: "en",
231
231
  langPack: "",
232
232
  // "langPacks are for official apps only"
@@ -219,7 +219,7 @@ class NetworkManager {
219
219
  _: "initConnection",
220
220
  deviceModel,
221
221
  systemVersion: "1.0",
222
- appVersion: "0.29.1",
222
+ appVersion: "0.29.4",
223
223
  systemLangCode: "en",
224
224
  langPack: "",
225
225
  // "langPacks are for official apps only"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.29.1",
4
+ "version": "0.29.4",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/tl/inner-tl.cjs CHANGED
@@ -28,8 +28,8 @@ class RpcError extends Error {
28
28
  }
29
29
  }
30
30
  RpcError.fromTl = function(obj) {
31
- var err = new RpcError(obj.errorCode, obj.errorMessage);
32
- var match;
31
+ const err = new RpcError(obj.errorCode, obj.errorMessage);
32
+ let match;
33
33
  if ((match = err.text.match(/^FLOOD_WAIT_(\d+)$/)) != null) {
34
34
  err.text = "FLOOD_WAIT_%d";
35
35
  err.seconds = parseInt(match[1]);
@@ -81,7 +81,8 @@ RpcError.fromTl = function(obj) {
81
81
  } else if ((match = err.text.match(/^USER_MIGRATE_(\d+)$/)) != null) {
82
82
  err.text = "USER_MIGRATE_%d";
83
83
  err.newDc = parseInt(match[1]);
84
- } else return err;
84
+ }
85
+ return err;
85
86
  };
86
87
  RpcError.BAD_REQUEST = 400;
87
88
  RpcError.UNAUTHORIZED = 401;
package/tl/inner-tl.js CHANGED
@@ -21,8 +21,8 @@ class RpcError extends Error {
21
21
  }
22
22
  }
23
23
  RpcError.fromTl = function(obj) {
24
- var err = new RpcError(obj.errorCode, obj.errorMessage);
25
- var match;
24
+ const err = new RpcError(obj.errorCode, obj.errorMessage);
25
+ let match;
26
26
  if ((match = err.text.match(/^FLOOD_WAIT_(\d+)$/)) != null) {
27
27
  err.text = "FLOOD_WAIT_%d";
28
28
  err.seconds = parseInt(match[1]);
@@ -74,7 +74,8 @@ RpcError.fromTl = function(obj) {
74
74
  } else if ((match = err.text.match(/^USER_MIGRATE_(\d+)$/)) != null) {
75
75
  err.text = "USER_MIGRATE_%d";
76
76
  err.newDc = parseInt(match[1]);
77
- } else return err;
77
+ }
78
+ return err;
78
79
  };
79
80
  RpcError.BAD_REQUEST = 400;
80
81
  RpcError.UNAUTHORIZED = 401;