@mtcute/core 0.29.0 → 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.
- package/highlevel/base.cjs +3 -2
- package/highlevel/base.js +3 -2
- package/highlevel/types/peers/peer.d.cts +1 -1
- package/highlevel/types/peers/peer.d.ts +1 -1
- package/highlevel/utils/peer-utils.cjs +21 -0
- package/highlevel/utils/peer-utils.d.cts +1 -1
- package/highlevel/utils/peer-utils.d.ts +1 -1
- package/highlevel/utils/peer-utils.js +21 -0
- package/network/client.cjs +3 -2
- package/network/client.js +3 -2
- package/network/network-manager.cjs +4 -2
- package/network/network-manager.js +4 -2
- package/package.json +1 -1
- package/tl/inner-tl.cjs +4 -3
- package/tl/inner-tl.js +4 -3
- package/utils/misc-utils.cjs +8 -0
- package/utils/misc-utils.d.cts +2 -0
- package/utils/misc-utils.d.ts +2 -0
- package/utils/misc-utils.js +8 -0
- package/utils.cjs +1 -0
- package/utils.js +2 -1
package/highlevel/base.cjs
CHANGED
|
@@ -9,6 +9,7 @@ const utils = require("@fuman/utils");
|
|
|
9
9
|
const client = require("../network/client.cjs");
|
|
10
10
|
const functionUtils = require("../utils/function-utils.cjs");
|
|
11
11
|
const logger = require("../utils/logger.cjs");
|
|
12
|
+
const miscUtils = require("../utils/misc-utils.cjs");
|
|
12
13
|
const typeAssertions = require("../utils/type-assertions.cjs");
|
|
13
14
|
require("@mtcute/tl-runtime");
|
|
14
15
|
const appConfigManager = require("./managers/app-config-manager.cjs");
|
|
@@ -31,7 +32,7 @@ class BaseTelegramClient {
|
|
|
31
32
|
this.log = this.params.logger ?? new logger.LogManager("client", params.platform);
|
|
32
33
|
this.platform = this.params.platform;
|
|
33
34
|
this.mt = new client.MtClient({
|
|
34
|
-
...this.params,
|
|
35
|
+
...miscUtils.dropUndefined(this.params),
|
|
35
36
|
logger: this.log.create("mtproto"),
|
|
36
37
|
onError: (err) => {
|
|
37
38
|
if (this.onError.length > 0) {
|
|
@@ -59,7 +60,7 @@ class BaseTelegramClient {
|
|
|
59
60
|
this.crypto = this.mt.crypto;
|
|
60
61
|
this.storage = new storage.TelegramStorageManager(this.mt.storage, {
|
|
61
62
|
provider: this.params.storage,
|
|
62
|
-
...this.params.storageOptions
|
|
63
|
+
...miscUtils.dropUndefined(this.params.storageOptions)
|
|
63
64
|
});
|
|
64
65
|
this.timers = new timers.TimersManager(async (spec, abortSignal) => {
|
|
65
66
|
await this.call(spec.request, {
|
package/highlevel/base.js
CHANGED
|
@@ -2,6 +2,7 @@ import { unknownToError, Emitter } from "@fuman/utils";
|
|
|
2
2
|
import { MtClient } from "../network/client.js";
|
|
3
3
|
import { asyncResettable } from "../utils/function-utils.js";
|
|
4
4
|
import { LogManager } from "../utils/logger.js";
|
|
5
|
+
import { dropUndefined } from "../utils/misc-utils.js";
|
|
5
6
|
import { isTlRpcError } from "../utils/type-assertions.js";
|
|
6
7
|
import "@mtcute/tl-runtime";
|
|
7
8
|
import { AppConfigManager } from "./managers/app-config-manager.js";
|
|
@@ -24,7 +25,7 @@ class BaseTelegramClient {
|
|
|
24
25
|
this.log = this.params.logger ?? new LogManager("client", params.platform);
|
|
25
26
|
this.platform = this.params.platform;
|
|
26
27
|
this.mt = new MtClient({
|
|
27
|
-
...this.params,
|
|
28
|
+
...dropUndefined(this.params),
|
|
28
29
|
logger: this.log.create("mtproto"),
|
|
29
30
|
onError: (err) => {
|
|
30
31
|
if (this.onError.length > 0) {
|
|
@@ -52,7 +53,7 @@ class BaseTelegramClient {
|
|
|
52
53
|
this.crypto = this.mt.crypto;
|
|
53
54
|
this.storage = new TelegramStorageManager(this.mt.storage, {
|
|
54
55
|
provider: this.params.storage,
|
|
55
|
-
...this.params.storageOptions
|
|
56
|
+
...dropUndefined(this.params.storageOptions)
|
|
56
57
|
});
|
|
57
58
|
this.timers = new TimersManager(async (spec, abortSignal) => {
|
|
58
59
|
await this.call(spec.request, {
|
|
@@ -18,7 +18,7 @@ export type PeerType = 'user' | 'bot' | 'group' | 'channel' | 'supergroup';
|
|
|
18
18
|
* > * Telegram has moved to int64 IDs. Though, Levin [has confirmed](https://t.me/tdlibchat/25071)
|
|
19
19
|
* > that new IDs *will* still fit into int53, meaning JS integers are fine.
|
|
20
20
|
*/
|
|
21
|
-
export type InputPeerLike = 'me' | 'self' | 'some_username' | (string & {}) | number | tl.TypePeer | tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | {
|
|
21
|
+
export type InputPeerLike = 'me' | 'self' | 'some_username' | (string & {}) | number | tl.TypePeer | tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | tl.RawUser | tl.RawChannel | tl.RawChat | {
|
|
22
22
|
inputPeer: tl.TypeInputPeer;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
@@ -18,7 +18,7 @@ export type PeerType = 'user' | 'bot' | 'group' | 'channel' | 'supergroup';
|
|
|
18
18
|
* > * Telegram has moved to int64 IDs. Though, Levin [has confirmed](https://t.me/tdlibchat/25071)
|
|
19
19
|
* > that new IDs *will* still fit into int53, meaning JS integers are fine.
|
|
20
20
|
*/
|
|
21
|
-
export type InputPeerLike = 'me' | 'self' | 'some_username' | (string & {}) | number | tl.TypePeer | tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | {
|
|
21
|
+
export type InputPeerLike = 'me' | 'self' | 'some_username' | (string & {}) | number | tl.TypePeer | tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | tl.RawUser | tl.RawChannel | tl.RawChat | {
|
|
22
22
|
inputPeer: tl.TypeInputPeer;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
@@ -5,6 +5,7 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
+
const utils$1 = require("@fuman/utils");
|
|
8
9
|
const utils = require("../../types/utils.cjs");
|
|
9
10
|
const errors = require("../types/errors.cjs");
|
|
10
11
|
const innerTl = require("../../tl/inner-tl.cjs");
|
|
@@ -12,6 +13,26 @@ const INVITE_LINK_REGEX = /^(?:https?:\/\/)?(?:www\.)?t(?:elegram)?\.(?:org|me|d
|
|
|
12
13
|
function toInputPeer(res) {
|
|
13
14
|
if (innerTl.isAnyInputPeer(res)) return res;
|
|
14
15
|
switch (res._) {
|
|
16
|
+
case "user": {
|
|
17
|
+
return {
|
|
18
|
+
_: "inputPeerUser",
|
|
19
|
+
userId: res.id,
|
|
20
|
+
accessHash: utils$1.asNonNull(res.accessHash)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
case "chat": {
|
|
24
|
+
return {
|
|
25
|
+
_: "inputPeerChat",
|
|
26
|
+
chatId: res.id
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
case "channel": {
|
|
30
|
+
return {
|
|
31
|
+
_: "inputPeerChannel",
|
|
32
|
+
channelId: res.id,
|
|
33
|
+
accessHash: utils$1.asNonNull(res.accessHash)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
15
36
|
case "inputChannelEmpty":
|
|
16
37
|
case "inputUserEmpty":
|
|
17
38
|
return { _: "inputPeerEmpty" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputPeerLike } from '../types/peers/index.js';
|
|
2
2
|
import { tl } from '../../tl/index.js';
|
|
3
3
|
export declare const INVITE_LINK_REGEX: RegExp;
|
|
4
|
-
export declare function toInputPeer(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel): tl.TypeInputPeer;
|
|
4
|
+
export declare function toInputPeer(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | tl.RawUser | tl.RawChat | tl.RawChannel): tl.TypeInputPeer;
|
|
5
5
|
export declare function toInputUser(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel, input?: InputPeerLike): tl.TypeInputUser;
|
|
6
6
|
export declare function toInputChannel(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel, input?: InputPeerLike): tl.TypeInputChannel;
|
|
7
7
|
export declare function isInputPeerUser(obj: tl.TypeInputPeer): obj is tl.RawInputPeerUser | tl.RawInputPeerUserFromMessage | tl.RawInputPeerSelf;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputPeerLike } from '../types/peers/index.js';
|
|
2
2
|
import { tl } from '../../tl/index.js';
|
|
3
3
|
export declare const INVITE_LINK_REGEX: RegExp;
|
|
4
|
-
export declare function toInputPeer(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel): tl.TypeInputPeer;
|
|
4
|
+
export declare function toInputPeer(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel | tl.RawUser | tl.RawChat | tl.RawChannel): tl.TypeInputPeer;
|
|
5
5
|
export declare function toInputUser(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel, input?: InputPeerLike): tl.TypeInputUser;
|
|
6
6
|
export declare function toInputChannel(res: tl.TypeInputPeer | tl.TypeInputUser | tl.TypeInputChannel, input?: InputPeerLike): tl.TypeInputChannel;
|
|
7
7
|
export declare function isInputPeerUser(obj: tl.TypeInputPeer): obj is tl.RawInputPeerUser | tl.RawInputPeerUserFromMessage | tl.RawInputPeerSelf;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { asNonNull } from "@fuman/utils";
|
|
1
2
|
import { assertNever } from "../../types/utils.js";
|
|
2
3
|
import { MtInvalidPeerTypeError } from "../types/errors.js";
|
|
3
4
|
import { isAnyInputPeer, isAnyInputUser, isAnyInputChannel } from "../../tl/inner-tl.js";
|
|
@@ -5,6 +6,26 @@ const INVITE_LINK_REGEX = /^(?:https?:\/\/)?(?:www\.)?t(?:elegram)?\.(?:org|me|d
|
|
|
5
6
|
function toInputPeer(res) {
|
|
6
7
|
if (isAnyInputPeer(res)) return res;
|
|
7
8
|
switch (res._) {
|
|
9
|
+
case "user": {
|
|
10
|
+
return {
|
|
11
|
+
_: "inputPeerUser",
|
|
12
|
+
userId: res.id,
|
|
13
|
+
accessHash: asNonNull(res.accessHash)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
case "chat": {
|
|
17
|
+
return {
|
|
18
|
+
_: "inputPeerChat",
|
|
19
|
+
chatId: res.id
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
case "channel": {
|
|
23
|
+
return {
|
|
24
|
+
_: "inputPeerChannel",
|
|
25
|
+
channelId: res.id,
|
|
26
|
+
accessHash: asNonNull(res.accessHash)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
8
29
|
case "inputChannelEmpty":
|
|
9
30
|
case "inputUserEmpty":
|
|
10
31
|
return { _: "inputPeerEmpty" };
|
package/network/client.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const writer = require("../tl/binary/writer.cjs");
|
|
|
12
12
|
const dcs = require("../utils/dcs.cjs");
|
|
13
13
|
const functionUtils = require("../utils/function-utils.cjs");
|
|
14
14
|
const logger = require("../utils/logger.cjs");
|
|
15
|
+
const miscUtils = require("../utils/misc-utils.cjs");
|
|
15
16
|
const typeAssertions = require("../utils/type-assertions.cjs");
|
|
16
17
|
require("@mtcute/tl-runtime");
|
|
17
18
|
const configManager = require("./config-manager.cjs");
|
|
@@ -46,7 +47,7 @@ class MtClient {
|
|
|
46
47
|
readerMap: this._readerMap,
|
|
47
48
|
writerMap: this._writerMap,
|
|
48
49
|
platform: params.platform,
|
|
49
|
-
...params.storageOptions
|
|
50
|
+
...miscUtils.dropUndefined(params.storageOptions)
|
|
50
51
|
});
|
|
51
52
|
this.network = new networkManager.NetworkManager(
|
|
52
53
|
{
|
|
@@ -71,7 +72,7 @@ class MtClient {
|
|
|
71
72
|
onUpdate: this.onUpdate.emit.bind(this.onUpdate),
|
|
72
73
|
stopSignal: this.stopSignal,
|
|
73
74
|
platform: params.platform,
|
|
74
|
-
...params.network
|
|
75
|
+
...miscUtils.dropUndefined(params.network)
|
|
75
76
|
},
|
|
76
77
|
this._config
|
|
77
78
|
);
|
package/network/client.js
CHANGED
|
@@ -5,6 +5,7 @@ import { __tlWriterMap } from "../tl/binary/writer.js";
|
|
|
5
5
|
import { defaultTestIpv6Dc, defaultTestDc, defaultProductionIpv6Dc, defaultProductionDc } from "../utils/dcs.js";
|
|
6
6
|
import { asyncResettable } from "../utils/function-utils.js";
|
|
7
7
|
import { LogManager } from "../utils/logger.js";
|
|
8
|
+
import { dropUndefined } from "../utils/misc-utils.js";
|
|
8
9
|
import { isTlRpcError } from "../utils/type-assertions.js";
|
|
9
10
|
import "@mtcute/tl-runtime";
|
|
10
11
|
import { ConfigManager } from "./config-manager.js";
|
|
@@ -39,7 +40,7 @@ class MtClient {
|
|
|
39
40
|
readerMap: this._readerMap,
|
|
40
41
|
writerMap: this._writerMap,
|
|
41
42
|
platform: params.platform,
|
|
42
|
-
...params.storageOptions
|
|
43
|
+
...dropUndefined(params.storageOptions)
|
|
43
44
|
});
|
|
44
45
|
this.network = new NetworkManager(
|
|
45
46
|
{
|
|
@@ -64,7 +65,7 @@ class MtClient {
|
|
|
64
65
|
onUpdate: this.onUpdate.emit.bind(this.onUpdate),
|
|
65
66
|
stopSignal: this.stopSignal,
|
|
66
67
|
platform: params.platform,
|
|
67
|
-
...params.network
|
|
68
|
+
...dropUndefined(params.network)
|
|
68
69
|
},
|
|
69
70
|
this._config
|
|
70
71
|
);
|
|
@@ -7,7 +7,9 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const net = require("@fuman/net");
|
|
9
9
|
const utils = require("@fuman/utils");
|
|
10
|
+
const miscUtils = require("../utils/misc-utils.cjs");
|
|
10
11
|
const typeAssertions = require("../utils/type-assertions.cjs");
|
|
12
|
+
require("@mtcute/tl-runtime");
|
|
11
13
|
const _default = require("./middlewares/default.cjs");
|
|
12
14
|
const multiSessionConnection = require("./multi-session-connection.cjs");
|
|
13
15
|
const serverSalt = require("./server-salt.cjs");
|
|
@@ -224,12 +226,12 @@ class NetworkManager {
|
|
|
224
226
|
_: "initConnection",
|
|
225
227
|
deviceModel,
|
|
226
228
|
systemVersion: "1.0",
|
|
227
|
-
appVersion: "0.29.
|
|
229
|
+
appVersion: "0.29.4",
|
|
228
230
|
systemLangCode: "en",
|
|
229
231
|
langPack: "",
|
|
230
232
|
// "langPacks are for official apps only"
|
|
231
233
|
langCode: "en",
|
|
232
|
-
...params.initConnectionOptions
|
|
234
|
+
...miscUtils.dropUndefined(params.initConnectionOptions),
|
|
233
235
|
apiId: params.apiId,
|
|
234
236
|
// eslint-disable-next-line
|
|
235
237
|
query: null
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defaultReconnectionStrategy } from "@fuman/net";
|
|
2
2
|
import { asNonNull, Deferred, LruMap, composeMiddlewares } from "@fuman/utils";
|
|
3
|
+
import { dropUndefined } from "../utils/misc-utils.js";
|
|
3
4
|
import { isTlRpcError, assertTypeIs } from "../utils/type-assertions.js";
|
|
5
|
+
import "@mtcute/tl-runtime";
|
|
4
6
|
import { basic } from "./middlewares/default.js";
|
|
5
7
|
import { MultiSessionConnection } from "./multi-session-connection.js";
|
|
6
8
|
import { ServerSaltManager } from "./server-salt.js";
|
|
@@ -217,12 +219,12 @@ class NetworkManager {
|
|
|
217
219
|
_: "initConnection",
|
|
218
220
|
deviceModel,
|
|
219
221
|
systemVersion: "1.0",
|
|
220
|
-
appVersion: "0.29.
|
|
222
|
+
appVersion: "0.29.4",
|
|
221
223
|
systemLangCode: "en",
|
|
222
224
|
langPack: "",
|
|
223
225
|
// "langPacks are for official apps only"
|
|
224
226
|
langCode: "en",
|
|
225
|
-
...params.initConnectionOptions
|
|
227
|
+
...dropUndefined(params.initConnectionOptions),
|
|
226
228
|
apiId: params.apiId,
|
|
227
229
|
// eslint-disable-next-line
|
|
228
230
|
query: null
|
package/package.json
CHANGED
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
|
-
|
|
32
|
-
|
|
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
|
-
}
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
}
|
|
77
|
+
}
|
|
78
|
+
return err;
|
|
78
79
|
};
|
|
79
80
|
RpcError.BAD_REQUEST = 400;
|
|
80
81
|
RpcError.UNAUTHORIZED = 401;
|
package/utils/misc-utils.cjs
CHANGED
|
@@ -23,5 +23,13 @@ function sleepWithAbort(ms, signal) {
|
|
|
23
23
|
function getRandomInt(top) {
|
|
24
24
|
return Math.floor(Math.random() * top);
|
|
25
25
|
}
|
|
26
|
+
function dropUndefined(obj) {
|
|
27
|
+
if (!obj) return void 0;
|
|
28
|
+
for (const key in obj) {
|
|
29
|
+
if (obj[key] === void 0) delete obj[key];
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
exports.dropUndefined = dropUndefined;
|
|
26
34
|
exports.getRandomInt = getRandomInt;
|
|
27
35
|
exports.sleepWithAbort = sleepWithAbort;
|
package/utils/misc-utils.d.cts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function sleepWithAbort(ms: number, signal: AbortSignal): Promise<void>;
|
|
2
2
|
export declare function getRandomInt(top: number): number;
|
|
3
|
+
export declare function dropUndefined<T extends object>(obj: T): T;
|
|
4
|
+
export declare function dropUndefined<T extends object>(obj?: T): T | undefined;
|
package/utils/misc-utils.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function sleepWithAbort(ms: number, signal: AbortSignal): Promise<void>;
|
|
2
2
|
export declare function getRandomInt(top: number): number;
|
|
3
|
+
export declare function dropUndefined<T extends object>(obj: T): T;
|
|
4
|
+
export declare function dropUndefined<T extends object>(obj?: T): T | undefined;
|
package/utils/misc-utils.js
CHANGED
|
@@ -16,7 +16,15 @@ function sleepWithAbort(ms, signal) {
|
|
|
16
16
|
function getRandomInt(top) {
|
|
17
17
|
return Math.floor(Math.random() * top);
|
|
18
18
|
}
|
|
19
|
+
function dropUndefined(obj) {
|
|
20
|
+
if (!obj) return void 0;
|
|
21
|
+
for (const key in obj) {
|
|
22
|
+
if (obj[key] === void 0) delete obj[key];
|
|
23
|
+
}
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
19
26
|
export {
|
|
27
|
+
dropUndefined,
|
|
20
28
|
getRandomInt,
|
|
21
29
|
sleepWithAbort
|
|
22
30
|
};
|
package/utils.cjs
CHANGED
|
@@ -73,6 +73,7 @@ exports.longFromFastString = longUtils.longFromFastString;
|
|
|
73
73
|
exports.longToFastString = longUtils.longToFastString;
|
|
74
74
|
exports.randomLong = longUtils.randomLong;
|
|
75
75
|
exports.removeFromLongArray = longUtils.removeFromLongArray;
|
|
76
|
+
exports.dropUndefined = miscUtils$1.dropUndefined;
|
|
76
77
|
exports.getRandomInt = miscUtils$1.getRandomInt;
|
|
77
78
|
exports.sleepWithAbort = miscUtils$1.sleepWithAbort;
|
|
78
79
|
exports.getAllPeersFrom = peerUtils$1.getAllPeersFrom;
|
package/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ import { EarlyTimer } from "./utils/early-timer.js";
|
|
|
9
9
|
import { asyncResettable, throttle } from "./utils/function-utils.js";
|
|
10
10
|
import { LogManager, Logger } from "./utils/logger.js";
|
|
11
11
|
import { LongMap, LongSet, compareLongs, longFromBuffer, longFromFastString, longToFastString, randomLong, removeFromLongArray } from "./utils/long-utils.js";
|
|
12
|
-
import { getRandomInt, sleepWithAbort } from "./utils/misc-utils.js";
|
|
12
|
+
import { dropUndefined, getRandomInt, sleepWithAbort } from "./utils/misc-utils.js";
|
|
13
13
|
import { getAllPeersFrom, getBarePeerId, getBasicPeerType, getMarkedPeerId, parseMarkedPeerId, toggleChannelIdMark } from "./utils/peer-utils.js";
|
|
14
14
|
import { SortedArray } from "./utils/sorted-array.js";
|
|
15
15
|
import { jsonToTlJson, tlJsonToJson } from "./utils/tl-json.js";
|
|
@@ -68,6 +68,7 @@ export {
|
|
|
68
68
|
deserializePeersIndex,
|
|
69
69
|
deserializePeersIndexWithCompat,
|
|
70
70
|
determinePartSize,
|
|
71
|
+
dropUndefined,
|
|
71
72
|
encodeInlineMessageId,
|
|
72
73
|
encodeWaveform,
|
|
73
74
|
extractFileName,
|