@mtkruto/node 0.1.117 → 0.1.118

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.
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 166;
8
- export declare const APP_VERSION = "MTKruto 0.1.117";
8
+ export declare const APP_VERSION = "MTKruto 0.1.118";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
54
54
  export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
55
55
  export const INITIAL_DC = "2";
56
56
  export const LAYER = 166;
57
- export const APP_VERSION = "MTKruto 0.1.117";
57
+ export const APP_VERSION = "MTKruto 0.1.118";
58
58
  // @ts-ignore: lib
59
59
  export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
60
60
  export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -219,7 +219,7 @@ export class Client extends ClientAbstract {
219
219
  get toJSON() {
220
220
  return () => update;
221
221
  },
222
- });
222
+ }, false);
223
223
  });
224
224
  _Client_lastPropagatedConnectionState.set(this, null);
225
225
  Object.defineProperty(this, "stateChangeHandler", {
@@ -1 +1 @@
1
- export declare function cleanObject<T extends Record<string, any>>(object: T): T;
1
+ export declare function cleanObject<T extends Record<string, any>>(object: T, recursive?: boolean): T;
@@ -1,13 +1,15 @@
1
1
  // deno-lint-ignore no-explicit-any
2
- export function cleanObject(object) {
2
+ export function cleanObject(object, recursive = true) {
3
3
  for (const [k, v] of Object.entries(object)) {
4
4
  switch (typeof v) {
5
5
  case "undefined":
6
6
  delete object[k];
7
7
  break;
8
8
  case "object":
9
- // @ts-ignore: this works, no idea why it complains
10
- object[k] = cleanObject(v);
9
+ if (recursive) {
10
+ // @ts-ignore: this works, no idea why it complains
11
+ object[k] = cleanObject(v);
12
+ }
11
13
  }
12
14
  }
13
15
  return object;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
4
  "name": "@mtkruto/node",
5
- "version": "0.1.117",
5
+ "version": "0.1.118",
6
6
  "description": "MTKruto for Node.js",
7
7
  "author": "Roj <rojvv@icloud.com>",
8
8
  "license": "LGPL-3.0-or-later",
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 166;
8
- export declare const APP_VERSION = "MTKruto 0.1.117";
8
+ export declare const APP_VERSION = "MTKruto 0.1.118";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
80
80
  exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
81
81
  exports.INITIAL_DC = "2";
82
82
  exports.LAYER = 166;
83
- exports.APP_VERSION = "MTKruto 0.1.117";
83
+ exports.APP_VERSION = "MTKruto 0.1.118";
84
84
  // @ts-ignore: lib
85
85
  exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
86
86
  exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -224,7 +224,7 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
224
224
  get toJSON() {
225
225
  return () => update;
226
226
  },
227
- });
227
+ }, false);
228
228
  });
229
229
  _Client_lastPropagatedConnectionState.set(this, null);
230
230
  Object.defineProperty(this, "stateChangeHandler", {
@@ -1 +1 @@
1
- export declare function cleanObject<T extends Record<string, any>>(object: T): T;
1
+ export declare function cleanObject<T extends Record<string, any>>(object: T, recursive?: boolean): T;
@@ -2,15 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cleanObject = void 0;
4
4
  // deno-lint-ignore no-explicit-any
5
- function cleanObject(object) {
5
+ function cleanObject(object, recursive = true) {
6
6
  for (const [k, v] of Object.entries(object)) {
7
7
  switch (typeof v) {
8
8
  case "undefined":
9
9
  delete object[k];
10
10
  break;
11
11
  case "object":
12
- // @ts-ignore: this works, no idea why it complains
13
- object[k] = cleanObject(v);
12
+ if (recursive) {
13
+ // @ts-ignore: this works, no idea why it complains
14
+ object[k] = cleanObject(v);
15
+ }
14
16
  }
15
17
  }
16
18
  return object;