@mtkruto/node 0.50.0 → 0.50.1
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/esm/_dnt.shims.d.ts +5 -1
- package/esm/_dnt.shims.d.ts.map +1 -1
- package/esm/_dnt.shims.js +5 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -1
- package/esm/utilities/0_misc.d.ts +0 -19
- package/esm/utilities/0_misc.d.ts.map +1 -1
- package/esm/utilities/0_misc.js +4 -3
- package/package.json +2 -1
- package/script/_dnt.shims.d.ts +5 -1
- package/script/_dnt.shims.d.ts.map +1 -1
- package/script/_dnt.shims.js +9 -1
- package/script/_dnt.test_shims.d.ts.map +1 -1
- package/script/utilities/0_misc.d.ts +0 -19
- package/script/utilities/0_misc.d.ts.map +1 -1
- package/script/utilities/0_misc.js +36 -12
package/esm/_dnt.shims.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export { crypto, type Crypto, type SubtleCrypto, type AlgorithmIdentifier, type Algorithm, type RsaOaepParams, type BufferSource, type AesCtrParams, type AesCbcParams, type AesGcmParams, type CryptoKey, type KeyAlgorithm, type KeyType, type KeyUsage, type EcdhKeyDeriveParams, type HkdfParams, type HashAlgorithmIdentifier, type Pbkdf2Params, type AesDerivedKeyParams, type HmacImportParams, type JsonWebKey, type RsaOtherPrimesInfo, type KeyFormat, type RsaHashedKeyGenParams, type RsaKeyGenParams, type BigInteger, type EcKeyGenParams, type NamedCurve, type CryptoKeyPair, type AesKeyGenParams, type HmacKeyGenParams, type RsaHashedImportParams, type EcKeyImportParams, type AesKeyAlgorithm, type RsaPssParams, type EcdsaParams } from "@deno/shim-crypto";
|
|
2
|
+
export { alert, confirm, prompt } from "@deno/shim-prompts";
|
|
2
3
|
import { default as WebSocket } from "ws";
|
|
3
4
|
export { default as WebSocket } from "ws";
|
|
4
5
|
import { Deno } from "@deno/shim-deno";
|
|
5
6
|
export { Deno } from "@deno/shim-deno";
|
|
6
|
-
export declare const dntGlobalThis: Omit<typeof globalThis, "WebSocket" | "crypto" | "Deno"> & {
|
|
7
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, "alert" | "confirm" | "prompt" | "WebSocket" | "crypto" | "Deno"> & {
|
|
7
8
|
crypto: import("@deno/shim-crypto").Crypto;
|
|
9
|
+
alert: typeof globalThis.alert;
|
|
10
|
+
confirm: typeof globalThis.confirm;
|
|
11
|
+
prompt: typeof globalThis.prompt;
|
|
8
12
|
WebSocket: typeof WebSocket;
|
|
9
13
|
Deno: typeof Deno;
|
|
10
14
|
};
|
package/esm/_dnt.shims.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file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no/shim-crypto";
|
|
3
|
+
import { alert, confirm, prompt } from "@deno/shim-prompts";
|
|
4
|
+
export { alert, confirm, prompt } from "@deno/shim-prompts";
|
|
3
5
|
import { default as WebSocket } from "ws";
|
|
4
6
|
export { default as WebSocket } from "ws";
|
|
5
7
|
import { Deno } from "@deno/shim-deno";
|
|
6
8
|
export { Deno } from "@deno/shim-deno";
|
|
7
9
|
const dntGlobals = {
|
|
8
10
|
crypto,
|
|
11
|
+
alert,
|
|
12
|
+
confirm,
|
|
13
|
+
prompt,
|
|
9
14
|
WebSocket,
|
|
10
15
|
Deno,
|
|
11
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErvB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAUvC,eAAO,MAAM,aAAa;;;;;;;CAA2C,CAAC"}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
-
*
|
|
5
|
-
* This file is part of MTKruto.
|
|
6
|
-
*
|
|
7
|
-
* This program is free software: you can redistribute it and/or modify
|
|
8
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
-
* (at your option) any later version.
|
|
11
|
-
*
|
|
12
|
-
* This program is distributed in the hope that it will be useful,
|
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
* GNU Lesser General Public License for more details.
|
|
16
|
-
*
|
|
17
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
-
*/
|
|
20
1
|
export declare function drop(maybePromise: unknown): void;
|
|
21
2
|
export declare function mustPrompt(message: string): string;
|
|
22
3
|
export declare function mustPromptNumber(message: string): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_misc.d.ts","sourceRoot":"","sources":["../../src/utilities/0_misc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"0_misc.d.ts","sourceRoot":"","sources":["../../src/utilities/0_misc.ts"],"names":[],"mappings":"AAwBA,wBAAgB,IAAI,CAAC,YAAY,EAAE,OAAO,QAIzC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,UAOzC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,UAO/C;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAMnG;AAED,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,YAAa,CAAC;AAE7C,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UAEzC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,QAE7C;AAED,wBAAuB,qBAAqB,CAAC,MAAM,EAAE,cAAc,sCAWlE"}
|
package/esm/utilities/0_misc.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
+
import * as dntShim from "../_dnt.shims.js";
|
|
20
21
|
import { SECOND, unreachable } from "../0_deps.js";
|
|
21
22
|
export function drop(maybePromise) {
|
|
22
23
|
if (maybePromise !== undefined && maybePromise != null && typeof maybePromise === "object" && maybePromise instanceof Promise) {
|
|
@@ -24,7 +25,7 @@ export function drop(maybePromise) {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
export function mustPrompt(message) {
|
|
27
|
-
const result = prompt(message);
|
|
28
|
+
const result = dntShim.prompt(message);
|
|
28
29
|
if (result == null) {
|
|
29
30
|
throw unreachable();
|
|
30
31
|
}
|
|
@@ -41,9 +42,9 @@ export function mustPromptNumber(message) {
|
|
|
41
42
|
return result;
|
|
42
43
|
}
|
|
43
44
|
export function mustPromptOneOf(message, choices) {
|
|
44
|
-
let result = prompt(message);
|
|
45
|
+
let result = dntShim.prompt(message);
|
|
45
46
|
while (result == null || !choices.includes(result)) {
|
|
46
|
-
result = prompt(message);
|
|
47
|
+
result = dntShim.prompt(message);
|
|
47
48
|
}
|
|
48
49
|
return result;
|
|
49
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtkruto/node",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"description": "MTKruto for Node.js",
|
|
5
5
|
"author": "Roj <rojvv@icloud.com>",
|
|
6
6
|
"repository": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"htmlparser2": "10.0.0",
|
|
28
28
|
"@deno/shim-crypto": "~0.3.1",
|
|
29
|
+
"@deno/shim-prompts": "~0.1.0",
|
|
29
30
|
"ws": "^8.13.0",
|
|
30
31
|
"@deno/shim-deno": "~0.19.2",
|
|
31
32
|
"node-localstorage": "^3.0.5"
|
package/script/_dnt.shims.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export { crypto, type Crypto, type SubtleCrypto, type AlgorithmIdentifier, type Algorithm, type RsaOaepParams, type BufferSource, type AesCtrParams, type AesCbcParams, type AesGcmParams, type CryptoKey, type KeyAlgorithm, type KeyType, type KeyUsage, type EcdhKeyDeriveParams, type HkdfParams, type HashAlgorithmIdentifier, type Pbkdf2Params, type AesDerivedKeyParams, type HmacImportParams, type JsonWebKey, type RsaOtherPrimesInfo, type KeyFormat, type RsaHashedKeyGenParams, type RsaKeyGenParams, type BigInteger, type EcKeyGenParams, type NamedCurve, type CryptoKeyPair, type AesKeyGenParams, type HmacKeyGenParams, type RsaHashedImportParams, type EcKeyImportParams, type AesKeyAlgorithm, type RsaPssParams, type EcdsaParams } from "@deno/shim-crypto";
|
|
2
|
+
export { alert, confirm, prompt } from "@deno/shim-prompts";
|
|
2
3
|
import { default as WebSocket } from "ws";
|
|
3
4
|
export { default as WebSocket } from "ws";
|
|
4
5
|
import { Deno } from "@deno/shim-deno";
|
|
5
6
|
export { Deno } from "@deno/shim-deno";
|
|
6
|
-
export declare const dntGlobalThis: Omit<typeof globalThis, "WebSocket" | "crypto" | "Deno"> & {
|
|
7
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, "alert" | "confirm" | "prompt" | "WebSocket" | "crypto" | "Deno"> & {
|
|
7
8
|
crypto: import("@deno/shim-crypto").Crypto;
|
|
9
|
+
alert: typeof globalThis.alert;
|
|
10
|
+
confirm: typeof globalThis.confirm;
|
|
11
|
+
prompt: typeof globalThis.prompt;
|
|
8
12
|
WebSocket: typeof WebSocket;
|
|
9
13
|
Deno: typeof Deno;
|
|
10
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErvB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAUvC,eAAO,MAAM,aAAa;;;;;;;CAA2C,CAAC"}
|
package/script/_dnt.shims.js
CHANGED
|
@@ -3,10 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.dntGlobalThis = exports.Deno = exports.WebSocket = exports.crypto = void 0;
|
|
6
|
+
exports.dntGlobalThis = exports.Deno = exports.WebSocket = exports.prompt = exports.confirm = exports.alert = exports.crypto = void 0;
|
|
7
7
|
const shim_crypto_1 = require("@deno/shim-crypto");
|
|
8
8
|
var shim_crypto_2 = require("@deno/shim-crypto");
|
|
9
9
|
Object.defineProperty(exports, "crypto", { enumerable: true, get: function () { return shim_crypto_2.crypto; } });
|
|
10
|
+
const shim_prompts_1 = require("@deno/shim-prompts");
|
|
11
|
+
var shim_prompts_2 = require("@deno/shim-prompts");
|
|
12
|
+
Object.defineProperty(exports, "alert", { enumerable: true, get: function () { return shim_prompts_2.alert; } });
|
|
13
|
+
Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return shim_prompts_2.confirm; } });
|
|
14
|
+
Object.defineProperty(exports, "prompt", { enumerable: true, get: function () { return shim_prompts_2.prompt; } });
|
|
10
15
|
const ws_1 = __importDefault(require("ws"));
|
|
11
16
|
var ws_2 = require("ws");
|
|
12
17
|
Object.defineProperty(exports, "WebSocket", { enumerable: true, get: function () { return __importDefault(ws_2).default; } });
|
|
@@ -15,6 +20,9 @@ var shim_deno_2 = require("@deno/shim-deno");
|
|
|
15
20
|
Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
|
|
16
21
|
const dntGlobals = {
|
|
17
22
|
crypto: shim_crypto_1.crypto,
|
|
23
|
+
alert: shim_prompts_1.alert,
|
|
24
|
+
confirm: shim_prompts_1.confirm,
|
|
25
|
+
prompt: shim_prompts_1.prompt,
|
|
18
26
|
WebSocket: ws_1.default,
|
|
19
27
|
Deno: shim_deno_1.Deno,
|
|
20
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,KAA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;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAUvC,eAAO,MAAM,aAAa;;;;;;;CAA2C,CAAC"}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
-
*
|
|
5
|
-
* This file is part of MTKruto.
|
|
6
|
-
*
|
|
7
|
-
* This program is free software: you can redistribute it and/or modify
|
|
8
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
-
* (at your option) any later version.
|
|
11
|
-
*
|
|
12
|
-
* This program is distributed in the hope that it will be useful,
|
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
* GNU Lesser General Public License for more details.
|
|
16
|
-
*
|
|
17
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
-
*/
|
|
20
1
|
export declare function drop(maybePromise: unknown): void;
|
|
21
2
|
export declare function mustPrompt(message: string): string;
|
|
22
3
|
export declare function mustPromptNumber(message: string): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_misc.d.ts","sourceRoot":"","sources":["../../src/utilities/0_misc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"0_misc.d.ts","sourceRoot":"","sources":["../../src/utilities/0_misc.ts"],"names":[],"mappings":"AAwBA,wBAAgB,IAAI,CAAC,YAAY,EAAE,OAAO,QAIzC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,UAOzC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,UAO/C;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAMnG;AAED,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,YAAa,CAAC;AAE7C,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UAEzC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,QAE7C;AAED,wBAAuB,qBAAqB,CAAC,MAAM,EAAE,cAAc,sCAWlE"}
|
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.VECTOR_CONSTRUCTOR = exports.ZERO_CHANNEL_ID = void 0;
|
|
27
|
+
exports.drop = drop;
|
|
28
|
+
exports.mustPrompt = mustPrompt;
|
|
29
|
+
exports.mustPromptNumber = mustPromptNumber;
|
|
30
|
+
exports.mustPromptOneOf = mustPromptOneOf;
|
|
31
|
+
exports.toUnixTimestamp = toUnixTimestamp;
|
|
32
|
+
exports.fromUnixTimestamp = fromUnixTimestamp;
|
|
33
|
+
exports.iterateReadableStream = iterateReadableStream;
|
|
2
34
|
/**
|
|
3
35
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
36
|
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
@@ -18,15 +50,7 @@
|
|
|
18
50
|
* You should have received a copy of the GNU Lesser General Public License
|
|
19
51
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
52
|
*/
|
|
21
|
-
|
|
22
|
-
exports.VECTOR_CONSTRUCTOR = exports.ZERO_CHANNEL_ID = void 0;
|
|
23
|
-
exports.drop = drop;
|
|
24
|
-
exports.mustPrompt = mustPrompt;
|
|
25
|
-
exports.mustPromptNumber = mustPromptNumber;
|
|
26
|
-
exports.mustPromptOneOf = mustPromptOneOf;
|
|
27
|
-
exports.toUnixTimestamp = toUnixTimestamp;
|
|
28
|
-
exports.fromUnixTimestamp = fromUnixTimestamp;
|
|
29
|
-
exports.iterateReadableStream = iterateReadableStream;
|
|
53
|
+
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
30
54
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
31
55
|
function drop(maybePromise) {
|
|
32
56
|
if (maybePromise !== undefined && maybePromise != null && typeof maybePromise === "object" && maybePromise instanceof Promise) {
|
|
@@ -34,7 +58,7 @@ function drop(maybePromise) {
|
|
|
34
58
|
}
|
|
35
59
|
}
|
|
36
60
|
function mustPrompt(message) {
|
|
37
|
-
const result = prompt(message);
|
|
61
|
+
const result = dntShim.prompt(message);
|
|
38
62
|
if (result == null) {
|
|
39
63
|
throw (0, _0_deps_js_1.unreachable)();
|
|
40
64
|
}
|
|
@@ -51,9 +75,9 @@ function mustPromptNumber(message) {
|
|
|
51
75
|
return result;
|
|
52
76
|
}
|
|
53
77
|
function mustPromptOneOf(message, choices) {
|
|
54
|
-
let result = prompt(message);
|
|
78
|
+
let result = dntShim.prompt(message);
|
|
55
79
|
while (result == null || !choices.includes(result)) {
|
|
56
|
-
result = prompt(message);
|
|
80
|
+
result = dntShim.prompt(message);
|
|
57
81
|
}
|
|
58
82
|
return result;
|
|
59
83
|
}
|