@mtkruto/node 0.1.289 → 0.1.299

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.
Files changed (114) hide show
  1. package/README.md +77 -1
  2. package/esm/client/4_client.js +1 -1
  3. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +83 -0
  4. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +203 -0
  5. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +50 -0
  6. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +274 -0
  7. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +47 -0
  8. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +51 -0
  9. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +66 -0
  10. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +191 -0
  11. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +168 -0
  12. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +385 -0
  13. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +159 -0
  14. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +431 -0
  15. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +181 -0
  16. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +1046 -0
  17. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +42 -0
  18. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +52 -0
  19. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +11 -0
  20. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +122 -0
  21. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +1 -0
  22. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +24 -0
  23. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +46 -0
  24. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +121 -0
  25. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +31 -0
  26. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +30 -0
  27. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +2128 -0
  28. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +2127 -0
  29. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +109 -0
  30. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +108 -0
  31. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +8 -0
  32. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +1 -0
  33. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +90 -0
  34. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +95 -0
  35. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +50 -0
  36. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +128 -0
  37. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +46 -0
  38. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +110 -0
  39. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +42 -0
  40. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +120 -0
  41. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +6 -0
  42. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +6 -0
  43. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +54 -0
  44. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +110 -0
  45. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +40 -0
  46. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +75 -0
  47. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +58 -0
  48. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +101 -0
  49. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.d.ts +2 -0
  50. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.js +5 -1
  51. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.d.ts +2 -2
  52. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.js +5 -1
  53. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/crc32.js +1 -1
  54. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/deflate.js +8 -8
  55. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inffast.js +2 -2
  56. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inflate.js +19 -21
  57. package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/trees.js +3 -3
  58. package/package.json +1 -1
  59. package/script/client/4_client.js +1 -1
  60. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +83 -0
  61. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +207 -0
  62. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +50 -0
  63. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +301 -0
  64. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +47 -0
  65. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +55 -0
  66. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +66 -0
  67. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +222 -0
  68. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +168 -0
  69. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +404 -0
  70. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +159 -0
  71. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +438 -0
  72. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +181 -0
  73. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +1052 -0
  74. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +42 -0
  75. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +88 -0
  76. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +11 -0
  77. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +128 -0
  78. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +1 -0
  79. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +30 -0
  80. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +46 -0
  81. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +129 -0
  82. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +31 -0
  83. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +32 -0
  84. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +2128 -0
  85. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +2129 -0
  86. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +109 -0
  87. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +110 -0
  88. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +8 -0
  89. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +3 -0
  90. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +90 -0
  91. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +114 -0
  92. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +50 -0
  93. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +134 -0
  94. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +46 -0
  95. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +118 -0
  96. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +42 -0
  97. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +129 -0
  98. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +6 -0
  99. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +22 -0
  100. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +54 -0
  101. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +119 -0
  102. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +40 -0
  103. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +86 -0
  104. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +58 -0
  105. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +112 -0
  106. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.d.ts +2 -0
  107. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.js +7 -1
  108. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.d.ts +2 -2
  109. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.js +7 -1
  110. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/crc32.js +1 -1
  111. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/deflate.js +8 -8
  112. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inffast.js +2 -2
  113. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inflate.js +19 -21
  114. package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/trees.js +3 -3
@@ -0,0 +1,101 @@
1
+ import { isTag } from '../Node.js';
2
+ const emptyArray = [];
3
+ /**
4
+ * Get a node's children.
5
+ *
6
+ * @param elem Node to get the children of.
7
+ * @returns `elem`'s children, or an empty array.
8
+ */
9
+ export function getChildren(elem) {
10
+ return elem.children ?? emptyArray;
11
+ }
12
+ /**
13
+ * Get a node's parent.
14
+ *
15
+ * @param elem Node to get the parent of.
16
+ * @returns `elem`'s parent node.
17
+ */
18
+ export function getParent(elem) {
19
+ return elem.parent || null;
20
+ }
21
+ /**
22
+ * Gets an elements siblings, including the element itself.
23
+ *
24
+ * Attempts to get the children through the element's parent first.
25
+ * If we don't have a parent (the element is a root node),
26
+ * we walk the element's `prev` & `next` to get all remaining nodes.
27
+ *
28
+ * @param elem Element to get the siblings of.
29
+ * @returns `elem`'s siblings.
30
+ */
31
+ export function getSiblings(elem) {
32
+ const parent = getParent(elem);
33
+ if (parent != null)
34
+ return getChildren(parent);
35
+ const siblings = [elem];
36
+ let { prev, next } = elem;
37
+ while (prev != null) {
38
+ siblings.unshift(prev);
39
+ ({ prev } = prev);
40
+ }
41
+ while (next != null) {
42
+ siblings.push(next);
43
+ ({ next } = next);
44
+ }
45
+ return siblings;
46
+ }
47
+ /**
48
+ * Gets an attribute from an element.
49
+ *
50
+ * @param elem Element to check.
51
+ * @param name Attribute name to retrieve.
52
+ * @returns The element's attribute value, or `undefined`.
53
+ */
54
+ export function getAttributeValue(elem, name) {
55
+ return elem.attribs?.[name];
56
+ }
57
+ /**
58
+ * Checks whether an element has an attribute.
59
+ *
60
+ * @param elem Element to check.
61
+ * @param name Attribute name to look for.
62
+ * @returns Returns whether `elem` has the attribute `name`.
63
+ */
64
+ export function hasAttrib(elem, name) {
65
+ return (elem.attribs != null &&
66
+ Object.prototype.hasOwnProperty.call(elem.attribs, name) &&
67
+ elem.attribs[name] != null);
68
+ }
69
+ /**
70
+ * Get the tag name of an element.
71
+ *
72
+ * @param elem The element to get the name for.
73
+ * @returns The tag name of `elem`.
74
+ */
75
+ export function getName(elem) {
76
+ return elem.name;
77
+ }
78
+ /**
79
+ * Returns the next element sibling of a node.
80
+ *
81
+ * @param elem The element to get the next sibling of.
82
+ * @returns `elem`'s next sibling that is a tag.
83
+ */
84
+ export function nextElementSibling(elem) {
85
+ let { next } = elem;
86
+ while (next !== null && !isTag(next))
87
+ ({ next } = next);
88
+ return next;
89
+ }
90
+ /**
91
+ * Returns the previous element sibling of a node.
92
+ *
93
+ * @param elem The element to get the previous sibling of.
94
+ * @returns `elem`'s previous sibling that is a tag.
95
+ */
96
+ export function prevElementSibling(elem) {
97
+ let { prev } = elem;
98
+ while (prev !== null && !isTag(prev))
99
+ ({ prev } = prev);
100
+ return prev;
101
+ }
@@ -24,4 +24,6 @@ export declare class Deflate {
24
24
  constructor(options?: DeflateOptions);
25
25
  push(data: Uint8Array, mode: boolean | number): Uint8Array;
26
26
  }
27
+ export declare function deflate(input: Uint8Array, options?: DeflateOptions): Uint8Array;
28
+ export declare function deflateRaw(input: Uint8Array, options?: DeflateOptions): Uint8Array;
27
29
  export declare function gzip(input: Uint8Array, options?: DeflateOptions): Uint8Array;
@@ -121,7 +121,7 @@ export class Deflate {
121
121
  return concatUint8Array(chunks);
122
122
  }
123
123
  }
124
- function deflate(input, options = {}) {
124
+ export function deflate(input, options = {}) {
125
125
  const deflator = new Deflate(options);
126
126
  const result = deflator.push(input, true);
127
127
  // That will never happens, if you don't cheat with options :)
@@ -129,6 +129,10 @@ function deflate(input, options = {}) {
129
129
  throw deflator.msg || msg[deflator.err];
130
130
  return result;
131
131
  }
132
+ export function deflateRaw(input, options = {}) {
133
+ options.raw = true;
134
+ return deflate(input, options);
135
+ }
132
136
  export function gzip(input, options = {}) {
133
137
  options.gzip = true;
134
138
  return deflate(input, options);
@@ -18,6 +18,6 @@ export declare class Inflate {
18
18
  constructor(options: InflateOptions);
19
19
  push(data: Uint8Array, mode: boolean | number): Uint8Array;
20
20
  }
21
- declare function inflate(input: Uint8Array, options?: InflateOptions): Uint8Array;
21
+ export declare function inflate(input: Uint8Array, options?: InflateOptions): Uint8Array;
22
+ export declare function inflateRaw(input: Uint8Array, options?: InflateOptions): Uint8Array;
22
23
  export declare const gunzip: typeof inflate;
23
- export {};
@@ -161,7 +161,7 @@ export class Inflate {
161
161
  return concatUint8Array(chunks);
162
162
  }
163
163
  }
164
- function inflate(input, options = {}) {
164
+ export function inflate(input, options = {}) {
165
165
  const inflator = new Inflate(options);
166
166
  const result = inflator.push(input, true);
167
167
  // That will never happens, if you don't cheat with options :)
@@ -169,4 +169,8 @@ function inflate(input, options = {}) {
169
169
  throw inflator.msg || msg[inflator.err];
170
170
  return result;
171
171
  }
172
+ export function inflateRaw(input, options = {}) {
173
+ options.raw = true;
174
+ return inflate(input, options);
175
+ }
172
176
  export const gunzip = inflate;
@@ -5,7 +5,7 @@ export function makeTable() {
5
5
  for (let n = 0; n < 256; n++) {
6
6
  c = n;
7
7
  for (let k = 0; k < 8; k++) {
8
- c = (c & 1) ? (m ^ (c >>> 1)) : (c >>> 1);
8
+ c = ((c & 1) ? (m ^ (c >>> 1)) : (c >>> 1));
9
9
  }
10
10
  table[n] = c;
11
11
  }
@@ -53,7 +53,7 @@ const MAX_BITS = 15;
53
53
  /* All codes must not exceed MAX_BITS bits */
54
54
  const MIN_MATCH = 3;
55
55
  const MAX_MATCH = 258;
56
- const MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
56
+ const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
57
57
  const PRESET_DICT = 0x20;
58
58
  const INIT_STATE = 42;
59
59
  const EXTRA_STATE = 69;
@@ -72,7 +72,7 @@ function err(strm, errorCode) {
72
72
  return errorCode;
73
73
  }
74
74
  function rank(f) {
75
- return (f << 1) - (f > 4 ? 9 : 0);
75
+ return ((f) << 1) - ((f) > 4 ? 9 : 0);
76
76
  }
77
77
  function zero(buf) {
78
78
  buf.fill(0, 0, buf.length);
@@ -103,7 +103,7 @@ function flush_pending(strm) {
103
103
  }
104
104
  }
105
105
  function flush_block_only(s, last) {
106
- trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);
106
+ trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
107
107
  s.block_start = s.strstart;
108
108
  flush_pending(s.strm);
109
109
  }
@@ -291,13 +291,13 @@ function fill_window(s) {
291
291
  p = n;
292
292
  do {
293
293
  m = s.head[--p];
294
- s.head[p] = m >= _w_size ? m - _w_size : 0;
294
+ s.head[p] = (m >= _w_size ? m - _w_size : 0);
295
295
  } while (--n);
296
296
  n = _w_size;
297
297
  p = n;
298
298
  do {
299
299
  m = s.prev[--p];
300
- s.prev[p] = m >= _w_size ? m - _w_size : 0;
300
+ s.prev[p] = (m >= _w_size ? m - _w_size : 0);
301
301
  /* If n is not on any hash chain, prev[n] is garbage but
302
302
  * its value will never be used.
303
303
  */
@@ -578,7 +578,7 @@ function deflate_fast(s, flush) {
578
578
  /***/
579
579
  }
580
580
  }
581
- s.insert = (s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1;
581
+ s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
582
582
  if (flush === STATUS.Z_FINISH) {
583
583
  /*** FLUSH_BLOCK(s, 1); ***/
584
584
  flush_block_only(s, true);
@@ -1437,7 +1437,7 @@ function deflateResetKeep(strm) {
1437
1437
  s.wrap = -s.wrap;
1438
1438
  /* was made negative by deflate(..., Z_FINISH); */
1439
1439
  }
1440
- s.status = s.wrap ? INIT_STATE : BUSY_STATE;
1440
+ s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
1441
1441
  strm.adler = (s.wrap === 2)
1442
1442
  ? 0 // crc32(0, Z_NULL, 0)
1443
1443
  : 1; // adler32(0, Z_NULL, 0)
@@ -1598,7 +1598,7 @@ export function deflate(strm, flush) {
1598
1598
  else {
1599
1599
  level_flags = 3;
1600
1600
  }
1601
- header |= level_flags << 6;
1601
+ header |= (level_flags << 6);
1602
1602
  if (s.strstart !== 0)
1603
1603
  header |= PRESET_DICT;
1604
1604
  header += 31 - (header % 31);
@@ -313,8 +313,8 @@ export default function inflate_fast(strm, start) {
313
313
  /* update state and return */
314
314
  strm.next_in = _in;
315
315
  strm.next_out = _out;
316
- strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);
317
- strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);
316
+ strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
317
+ strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
318
318
  state.hold = hold;
319
319
  state.bits = bits;
320
320
  return;
@@ -618,7 +618,7 @@ export function inflate(strm, flush) {
618
618
  break;
619
619
  }
620
620
  if (state.head) {
621
- state.head.text = (hold >> 8) & 1;
621
+ state.head.text = ((hold >> 8) & 1);
622
622
  }
623
623
  if (state.flags & 0x0200) {
624
624
  //=== CRC2(state.check, hold);
@@ -672,8 +672,8 @@ export function inflate(strm, flush) {
672
672
  }
673
673
  //===//
674
674
  if (state.head) {
675
- state.head.xflags = hold & 0xff;
676
- state.head.os = hold >> 8;
675
+ state.head.xflags = (hold & 0xff);
676
+ state.head.os = (hold >> 8);
677
677
  }
678
678
  if (state.flags & 0x0200) {
679
679
  //=== CRC2(state.check, hold);
@@ -829,7 +829,7 @@ export function inflate(strm, flush) {
829
829
  //===//
830
830
  }
831
831
  if (state.head) {
832
- state.head.hcrc = (state.flags >> 9) & 1;
832
+ state.head.hcrc = ((state.flags >> 9) & 1);
833
833
  state.head.done = true;
834
834
  }
835
835
  strm.adler = state.check = 0;
@@ -889,7 +889,7 @@ export function inflate(strm, flush) {
889
889
  bits += 8;
890
890
  }
891
891
  //===//
892
- state.last = hold & 0x01 /*BITS(1)*/;
892
+ state.last = (hold & 0x01) /*BITS(1)*/;
893
893
  //--- DROPBITS(1) ---//
894
894
  hold >>>= 1;
895
895
  bits -= 1;
@@ -1029,7 +1029,7 @@ export function inflate(strm, flush) {
1029
1029
  bits += 8;
1030
1030
  }
1031
1031
  //===//
1032
- state.lens[order[state.have++]] = hold & 0x07; //BITS(3);
1032
+ state.lens[order[state.have++]] = (hold & 0x07); //BITS(3);
1033
1033
  //--- DROPBITS(3) ---//
1034
1034
  hold >>>= 3;
1035
1035
  bits -= 3;
@@ -1064,7 +1064,7 @@ export function inflate(strm, flush) {
1064
1064
  here_bits = here >>> 24;
1065
1065
  here_op = (here >>> 16) & 0xff;
1066
1066
  here_val = here & 0xffff;
1067
- if (here_bits <= bits)
1067
+ if ((here_bits) <= bits)
1068
1068
  break;
1069
1069
  //--- PULLBYTE() ---//
1070
1070
  if (have === 0)
@@ -1338,7 +1338,7 @@ export function inflate(strm, flush) {
1338
1338
  here_bits = here >>> 24;
1339
1339
  here_op = (here >>> 16) & 0xff;
1340
1340
  here_val = here & 0xffff;
1341
- if (here_bits <= bits)
1341
+ if ((here_bits) <= bits)
1342
1342
  break;
1343
1343
  //--- PULLBYTE() ---//
1344
1344
  if (have === 0)
@@ -1387,7 +1387,7 @@ export function inflate(strm, flush) {
1387
1387
  break;
1388
1388
  }
1389
1389
  state.offset = here_val;
1390
- state.extra = here_op & 15;
1390
+ state.extra = (here_op) & 15;
1391
1391
  state.mode = DISTEXT;
1392
1392
  /* falls through */
1393
1393
  case DISTEXT:
@@ -1498,12 +1498,11 @@ export function inflate(strm, flush) {
1498
1498
  strm.total_out += _out;
1499
1499
  state.total += _out;
1500
1500
  if (_out) {
1501
- strm.adler =
1502
- state.check =
1503
- /*UPDATE(state.check, put - _out, _out);*/
1504
- state.flags
1505
- ? crc32(state.check, output, _out, put - _out)
1506
- : adler32(state.check, output, _out, put - _out);
1501
+ strm.adler = state.check =
1502
+ /*UPDATE(state.check, put - _out, _out);*/
1503
+ (state.flags
1504
+ ? crc32(state.check, output, _out, put - _out)
1505
+ : adler32(state.check, output, _out, put - _out));
1507
1506
  }
1508
1507
  _out = left;
1509
1508
  // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
@@ -1586,12 +1585,11 @@ export function inflate(strm, flush) {
1586
1585
  strm.total_out += _out;
1587
1586
  state.total += _out;
1588
1587
  if (state.wrap && _out) {
1589
- strm.adler =
1590
- state
1591
- .check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
1592
- state.flags
1593
- ? crc32(state.check, output, _out, strm.next_out - _out)
1594
- : adler32(state.check, output, _out, strm.next_out - _out);
1588
+ strm.adler = state
1589
+ .check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
1590
+ (state.flags
1591
+ ? crc32(state.check, output, _out, strm.next_out - _out)
1592
+ : adler32(state.check, output, _out, strm.next_out - _out));
1595
1593
  }
1596
1594
  strm.data_type = state.bits + (state.last ? 64 : 0) +
1597
1595
  (state.mode === TYPE ? 128 : 0) +
@@ -261,7 +261,7 @@ function d_code(dist) {
261
261
  function put_short(s, w) {
262
262
  // put_byte(s, (uch)((w) & 0xff));
263
263
  // put_byte(s, (uch)((ush)(w) >> 8));
264
- s.pending_buf[s.pending++] = w & 0xff;
264
+ s.pending_buf[s.pending++] = (w) & 0xff;
265
265
  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
266
266
  }
267
267
  /* ===========================================================================
@@ -696,7 +696,7 @@ function build_tree(s, desc) {
696
696
  * two codes of non zero frequency.
697
697
  */
698
698
  while (s.heap_len < 2) {
699
- node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
699
+ node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
700
700
  tree[node * 2] /*.Freq*/ = 1;
701
701
  s.depth[node] = 0;
702
702
  s.opt_len--;
@@ -709,7 +709,7 @@ function build_tree(s, desc) {
709
709
  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
710
710
  * establish sub-heaps of increasing lengths:
711
711
  */
712
- for (n = s.heap_len >> 1 /*int /2*/; n >= 1; n--)
712
+ for (n = (s.heap_len >> 1 /*int /2*/); n >= 1; n--)
713
713
  pqdownheap(s, tree, n);
714
714
  /* Construct the Huffman tree by repeatedly combining the least two
715
715
  * frequent nodes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.1.289",
3
+ "version": "0.1.299",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -1145,7 +1145,7 @@ class Client extends Composer {
1145
1145
  if (!this.connected) {
1146
1146
  continue;
1147
1147
  }
1148
- __classPrivateFieldGet(this, _Client_pingLoopAbortController, "f").signal.throwIfAborted();
1148
+ __classPrivateFieldGet(this, _Client_pingLoopAbortController, "f")?.signal.throwIfAborted();
1149
1149
  await this.api.ping_delay_disconnect({ ping_id: (0, _1_utilities_js_1.getRandomId)(), disconnect_delay: __classPrivateFieldGet(this, _Client_pingInterval, "f") / 1000 + 15 });
1150
1150
  if (Date.now() - __classPrivateFieldGet(this, _Client_lastUpdates, "f").getTime() >= 15 * 60 * 1000) {
1151
1151
  (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap("lastUpdates"));
@@ -0,0 +1,83 @@
1
+ import { Node, Element, Document, NodeWithChildren, DataNode } from './Node.js';
2
+ export interface DomHandlerOptions {
3
+ /**
4
+ * Add a `startIndex` property to nodes.
5
+ * When the parser is used in a non-streaming fashion, `startIndex` is an integer
6
+ * indicating the position of the start of the node in the document.
7
+ *
8
+ * @default false
9
+ */
10
+ withStartIndices?: boolean;
11
+ /**
12
+ * Add an `endIndex` property to nodes.
13
+ * When the parser is used in a non-streaming fashion, `endIndex` is an integer
14
+ * indicating the position of the end of the node in the document.
15
+ *
16
+ * @default false
17
+ */
18
+ withEndIndices?: boolean;
19
+ /**
20
+ * Replace all whitespace with single spaces.
21
+ *
22
+ * **Note:** Enabling this might break your markup.
23
+ *
24
+ * @default false
25
+ * @deprecated
26
+ */
27
+ normalizeWhitespace?: boolean;
28
+ /**
29
+ * Treat the markup as XML.
30
+ *
31
+ * @default false
32
+ */
33
+ xmlMode?: boolean;
34
+ }
35
+ interface ParserInterface {
36
+ startIndex: number | null;
37
+ endIndex: number | null;
38
+ }
39
+ type Callback = (error: Error | null, dom: Node[]) => void;
40
+ type ElementCallback = (element: Element) => void;
41
+ export declare class DomHandler {
42
+ /** The elements of the DOM */
43
+ dom: Node[];
44
+ /** The root element for the DOM */
45
+ root: Document;
46
+ /** Called once parsing has completed. */
47
+ private readonly callback;
48
+ /** Settings for the handler. */
49
+ private readonly options;
50
+ /** Callback whenever a tag is closed. */
51
+ private readonly elementCB;
52
+ /** Indicated whether parsing has been completed. */
53
+ private done;
54
+ /** Stack of open tags. */
55
+ protected tagStack: NodeWithChildren[];
56
+ /** A data node that is still being written to. */
57
+ protected lastNode: DataNode | null;
58
+ /** Reference to the parser instance. Used for location information. */
59
+ private parser;
60
+ /**
61
+ * @param callback Called once parsing has completed.
62
+ * @param options Settings for the handler.
63
+ * @param elementCB Callback whenever a tag is closed.
64
+ */
65
+ constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
66
+ onparserinit(parser: ParserInterface): void;
67
+ onreset(): void;
68
+ onend(): void;
69
+ onerror(error: Error): void;
70
+ onclosetag(): void;
71
+ onopentag(name: string, attribs: {
72
+ [key: string]: string;
73
+ }): void;
74
+ ontext(data: string): void;
75
+ oncomment(data: string): void;
76
+ oncommentend(): void;
77
+ oncdatastart(): void;
78
+ oncdataend(): void;
79
+ onprocessinginstruction(name: string, data: string): void;
80
+ protected handleCallback(error: Error | null): void;
81
+ protected addNode(node: Node): void;
82
+ }
83
+ export default DomHandler;