@sanctumterra/raknet 1.3.79 → 1.4.0

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 (286) hide show
  1. package/README.md +1 -1
  2. package/dist/client/client.d.ts +19 -24
  3. package/dist/client/client.d.ts.map +1 -1
  4. package/dist/client/client.js +135 -278
  5. package/dist/client/index.d.ts +1 -2
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +1 -2
  8. package/dist/client/types/client-events.d.ts +8 -0
  9. package/dist/client/types/client-events.d.ts.map +1 -0
  10. package/dist/client/types/client-options.d.ts +12 -0
  11. package/dist/client/types/client-options.d.ts.map +1 -0
  12. package/dist/client/types/client-options.js +14 -0
  13. package/dist/client/types/index.d.ts +3 -0
  14. package/dist/client/types/index.d.ts.map +1 -0
  15. package/dist/{proto/decorators → client/types}/index.js +2 -2
  16. package/dist/index.d.ts +1 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -3
  19. package/dist/server/connection.d.ts +20 -59
  20. package/dist/server/connection.d.ts.map +1 -1
  21. package/dist/server/connection.js +53 -365
  22. package/dist/server/index.d.ts +2 -3
  23. package/dist/server/index.d.ts.map +1 -1
  24. package/dist/server/index.js +2 -3
  25. package/dist/server/server.d.ts +11 -18
  26. package/dist/server/server.d.ts.map +1 -1
  27. package/dist/server/server.js +98 -137
  28. package/dist/{proto → server}/types/advertisement.d.ts +1 -1
  29. package/dist/server/types/advertisement.d.ts.map +1 -0
  30. package/dist/{proto → server}/types/advertisement.js +14 -10
  31. package/dist/server/types/connection-events.d.ts +4 -0
  32. package/dist/server/types/connection-events.d.ts.map +1 -0
  33. package/dist/server/types/index.d.ts +5 -0
  34. package/dist/server/types/index.d.ts.map +1 -0
  35. package/dist/{proto → server}/types/index.js +3 -1
  36. package/dist/server/types/server-events.d.ts +7 -0
  37. package/dist/server/types/server-events.d.ts.map +1 -0
  38. package/dist/server/types/server-options.d.ts +12 -0
  39. package/dist/server/types/server-options.d.ts.map +1 -0
  40. package/dist/server/types/server-options.js +14 -0
  41. package/dist/shared/emitter.d.ts +28 -0
  42. package/dist/shared/emitter.d.ts.map +1 -0
  43. package/dist/shared/emitter.js +71 -0
  44. package/dist/shared/index.d.ts +5 -0
  45. package/dist/shared/index.d.ts.map +1 -0
  46. package/dist/{utils → shared}/index.js +4 -1
  47. package/dist/{utils/Logger.d.ts → shared/logger.d.ts} +1 -1
  48. package/dist/shared/logger.d.ts.map +1 -0
  49. package/dist/shared/network_session.d.ts +34 -0
  50. package/dist/shared/network_session.d.ts.map +1 -0
  51. package/dist/shared/network_session.js +247 -0
  52. package/dist/shared/proto/enums/connectionStatus.d.ts +8 -0
  53. package/dist/shared/proto/enums/connectionStatus.d.ts.map +1 -0
  54. package/dist/shared/proto/enums/connectionStatus.js +11 -0
  55. package/dist/shared/proto/enums/index.d.ts +5 -0
  56. package/dist/shared/proto/enums/index.d.ts.map +1 -0
  57. package/dist/{proto → shared/proto}/enums/index.js +2 -3
  58. package/dist/shared/proto/enums/packets.d.ts +19 -0
  59. package/dist/shared/proto/enums/packets.d.ts.map +1 -0
  60. package/dist/shared/proto/enums/packets.js +23 -0
  61. package/dist/shared/proto/enums/priority.d.ts +6 -0
  62. package/dist/shared/proto/enums/priority.d.ts.map +1 -0
  63. package/dist/shared/proto/enums/priority.js +4 -0
  64. package/dist/shared/proto/enums/reliability.d.ts.map +1 -0
  65. package/dist/shared/proto/index.d.ts +5 -0
  66. package/dist/shared/proto/index.d.ts.map +1 -0
  67. package/dist/{proto → shared/proto}/index.js +3 -3
  68. package/dist/shared/proto/offline/index.d.ts +7 -0
  69. package/dist/shared/proto/offline/index.d.ts.map +1 -0
  70. package/dist/shared/proto/offline/index.js +22 -0
  71. package/dist/shared/proto/offline/open-connection-reply-one.d.ts +9 -0
  72. package/dist/shared/proto/offline/open-connection-reply-one.d.ts.map +1 -0
  73. package/dist/shared/proto/offline/open-connection-reply-one.js +28 -0
  74. package/dist/shared/proto/offline/open-connection-reply-two.d.ts +11 -0
  75. package/dist/shared/proto/offline/open-connection-reply-two.d.ts.map +1 -0
  76. package/dist/shared/proto/offline/open-connection-reply-two.js +31 -0
  77. package/dist/shared/proto/offline/open-connection-request-one.d.ts +8 -0
  78. package/dist/shared/proto/offline/open-connection-request-one.d.ts.map +1 -0
  79. package/dist/shared/proto/offline/open-connection-request-one.js +25 -0
  80. package/dist/shared/proto/offline/open-connection-request-two.d.ts +10 -0
  81. package/dist/shared/proto/offline/open-connection-request-two.d.ts.map +1 -0
  82. package/dist/shared/proto/offline/open-connection-request-two.js +28 -0
  83. package/dist/shared/proto/offline/unconnected-ping.d.ts +8 -0
  84. package/dist/shared/proto/offline/unconnected-ping.d.ts.map +1 -0
  85. package/dist/shared/proto/offline/unconnected-ping.js +25 -0
  86. package/dist/shared/proto/offline/unconnected-pong.d.ts +9 -0
  87. package/dist/shared/proto/offline/unconnected-pong.d.ts.map +1 -0
  88. package/dist/shared/proto/offline/unconnected-pong.js +28 -0
  89. package/dist/shared/proto/online/ack.d.ts +7 -0
  90. package/dist/shared/proto/online/ack.d.ts.map +1 -0
  91. package/dist/{proto/packets → shared/proto/online}/ack.js +16 -31
  92. package/dist/shared/proto/online/connected-ping.d.ts +7 -0
  93. package/dist/shared/proto/online/connected-ping.d.ts.map +1 -0
  94. package/dist/shared/proto/online/connected-ping.js +19 -0
  95. package/dist/shared/proto/online/connected-pong.d.ts +8 -0
  96. package/dist/shared/proto/online/connected-pong.d.ts.map +1 -0
  97. package/dist/shared/proto/online/connected-pong.js +22 -0
  98. package/dist/shared/proto/online/connection-request-accepted.d.ts +12 -0
  99. package/dist/shared/proto/online/connection-request-accepted.d.ts.map +1 -0
  100. package/dist/shared/proto/online/connection-request-accepted.js +37 -0
  101. package/dist/shared/proto/online/connection-request.d.ts +9 -0
  102. package/dist/shared/proto/online/connection-request.d.ts.map +1 -0
  103. package/dist/shared/proto/online/connection-request.js +25 -0
  104. package/dist/shared/proto/online/disconnect-message.d.ts +6 -0
  105. package/dist/shared/proto/online/disconnect-message.d.ts.map +1 -0
  106. package/dist/shared/proto/online/disconnect-message.js +15 -0
  107. package/dist/shared/proto/online/frame-set.d.ts +9 -0
  108. package/dist/shared/proto/online/frame-set.d.ts.map +1 -0
  109. package/dist/shared/proto/online/frame-set.js +23 -0
  110. package/dist/shared/proto/online/index.d.ts +9 -0
  111. package/dist/shared/proto/online/index.d.ts.map +1 -0
  112. package/dist/shared/proto/online/index.js +24 -0
  113. package/dist/shared/proto/online/new-incomming-connection.d.ts +11 -0
  114. package/dist/shared/proto/online/new-incomming-connection.d.ts.map +1 -0
  115. package/dist/shared/proto/online/new-incomming-connection.js +33 -0
  116. package/dist/shared/proto/types/address.d.ts +12 -0
  117. package/dist/shared/proto/types/address.d.ts.map +1 -0
  118. package/dist/shared/proto/types/address.js +61 -0
  119. package/dist/shared/proto/types/frame.d.ts +23 -0
  120. package/dist/shared/proto/types/frame.d.ts.map +1 -0
  121. package/dist/shared/proto/types/frame.js +119 -0
  122. package/dist/{proto/packets → shared/proto}/types/index.d.ts +0 -2
  123. package/dist/shared/proto/types/index.d.ts.map +1 -0
  124. package/dist/{proto/packets → shared/proto}/types/index.js +0 -2
  125. package/dist/shared/proto/types/magic.d.ts +7 -0
  126. package/dist/shared/proto/types/magic.d.ts.map +1 -0
  127. package/dist/shared/proto/types/magic.js +15 -0
  128. package/dist/shared/proto/types/mtu.d.ts +7 -0
  129. package/dist/shared/proto/types/mtu.d.ts.map +1 -0
  130. package/dist/shared/proto/types/mtu.js +13 -0
  131. package/dist/tests/client-connect.d.ts +2 -0
  132. package/dist/tests/client-connect.d.ts.map +1 -0
  133. package/dist/tests/client-connect.js +32 -0
  134. package/dist/tests/client-once.d.ts +2 -0
  135. package/dist/tests/client-once.d.ts.map +1 -0
  136. package/dist/tests/client-once.js +11 -0
  137. package/dist/tests/server-listen.d.ts +2 -0
  138. package/dist/tests/server-listen.d.ts.map +1 -0
  139. package/dist/tests/server-listen.js +5 -0
  140. package/package.json +8 -8
  141. package/bun.lock +0 -67
  142. package/dist/client/client-events.d.ts +0 -23
  143. package/dist/client/client-events.d.ts.map +0 -1
  144. package/dist/client/client-options.d.ts +0 -13
  145. package/dist/client/client-options.d.ts.map +0 -1
  146. package/dist/client/client-options.js +0 -14
  147. package/dist/client/client_options.d.ts +0 -10
  148. package/dist/client/client_options.d.ts.map +0 -1
  149. package/dist/client/client_options.js +0 -11
  150. package/dist/client/framer.d.ts +0 -56
  151. package/dist/client/framer.d.ts.map +0 -1
  152. package/dist/client/framer.js +0 -467
  153. package/dist/proto/decorators/create.d.ts +0 -8
  154. package/dist/proto/decorators/create.d.ts.map +0 -1
  155. package/dist/proto/decorators/create.js +0 -77
  156. package/dist/proto/decorators/index.d.ts +0 -3
  157. package/dist/proto/decorators/index.d.ts.map +0 -1
  158. package/dist/proto/decorators/serialize.d.ts +0 -4
  159. package/dist/proto/decorators/serialize.d.ts.map +0 -1
  160. package/dist/proto/decorators/serialize.js +0 -12
  161. package/dist/proto/enums/flags.d.ts +0 -7
  162. package/dist/proto/enums/flags.d.ts.map +0 -1
  163. package/dist/proto/enums/flags.js +0 -10
  164. package/dist/proto/enums/index.d.ts +0 -6
  165. package/dist/proto/enums/index.d.ts.map +0 -1
  166. package/dist/proto/enums/packet.d.ts +0 -122
  167. package/dist/proto/enums/packet.d.ts.map +0 -1
  168. package/dist/proto/enums/packet.js +0 -125
  169. package/dist/proto/enums/priority.d.ts +0 -5
  170. package/dist/proto/enums/priority.d.ts.map +0 -1
  171. package/dist/proto/enums/priority.js +0 -8
  172. package/dist/proto/enums/reliability.d.ts.map +0 -1
  173. package/dist/proto/enums/status.d.ts +0 -7
  174. package/dist/proto/enums/status.d.ts.map +0 -1
  175. package/dist/proto/enums/status.js +0 -10
  176. package/dist/proto/index.d.ts +0 -5
  177. package/dist/proto/index.d.ts.map +0 -1
  178. package/dist/proto/packets/ack.d.ts +0 -10
  179. package/dist/proto/packets/ack.d.ts.map +0 -1
  180. package/dist/proto/packets/base-packet.d.ts +0 -26
  181. package/dist/proto/packets/base-packet.d.ts.map +0 -1
  182. package/dist/proto/packets/base-packet.js +0 -37
  183. package/dist/proto/packets/connected-ping.d.ts +0 -5
  184. package/dist/proto/packets/connected-ping.d.ts.map +0 -1
  185. package/dist/proto/packets/connected-ping.js +0 -27
  186. package/dist/proto/packets/connected-pong.d.ts +0 -6
  187. package/dist/proto/packets/connected-pong.d.ts.map +0 -1
  188. package/dist/proto/packets/connected-pong.js +0 -32
  189. package/dist/proto/packets/connection-request-accepted.d.ts +0 -10
  190. package/dist/proto/packets/connection-request-accepted.d.ts.map +0 -1
  191. package/dist/proto/packets/connection-request-accepted.js +0 -48
  192. package/dist/proto/packets/connection-request.d.ts +0 -7
  193. package/dist/proto/packets/connection-request.d.ts.map +0 -1
  194. package/dist/proto/packets/connection-request.js +0 -37
  195. package/dist/proto/packets/disconnect.d.ts +0 -5
  196. package/dist/proto/packets/disconnect.d.ts.map +0 -1
  197. package/dist/proto/packets/disconnect.js +0 -17
  198. package/dist/proto/packets/frame.d.ts +0 -1
  199. package/dist/proto/packets/frame.d.ts.map +0 -1
  200. package/dist/proto/packets/frame.js +0 -1
  201. package/dist/proto/packets/frameset.d.ts +0 -11
  202. package/dist/proto/packets/frameset.d.ts.map +0 -1
  203. package/dist/proto/packets/frameset.js +0 -37
  204. package/dist/proto/packets/incompatible-protocol-version.d.ts +0 -8
  205. package/dist/proto/packets/incompatible-protocol-version.d.ts.map +0 -1
  206. package/dist/proto/packets/incompatible-protocol-version.js +0 -38
  207. package/dist/proto/packets/index.d.ts +0 -19
  208. package/dist/proto/packets/index.d.ts.map +0 -1
  209. package/dist/proto/packets/index.js +0 -34
  210. package/dist/proto/packets/nack.d.ts +0 -8
  211. package/dist/proto/packets/nack.d.ts.map +0 -1
  212. package/dist/proto/packets/nack.js +0 -88
  213. package/dist/proto/packets/new-incoming-connection.d.ts +0 -9
  214. package/dist/proto/packets/new-incoming-connection.d.ts.map +0 -1
  215. package/dist/proto/packets/new-incoming-connection.js +0 -43
  216. package/dist/proto/packets/open-connection-reply-one.d.ts +0 -8
  217. package/dist/proto/packets/open-connection-reply-one.d.ts.map +0 -1
  218. package/dist/proto/packets/open-connection-reply-one.js +0 -43
  219. package/dist/proto/packets/open-connection-reply-two.d.ts +0 -10
  220. package/dist/proto/packets/open-connection-reply-two.d.ts.map +0 -1
  221. package/dist/proto/packets/open-connection-reply-two.js +0 -48
  222. package/dist/proto/packets/open-connection-request-one.d.ts +0 -7
  223. package/dist/proto/packets/open-connection-request-one.d.ts.map +0 -1
  224. package/dist/proto/packets/open-connection-request-one.js +0 -38
  225. package/dist/proto/packets/open-connection-request-two.d.ts +0 -9
  226. package/dist/proto/packets/open-connection-request-two.d.ts.map +0 -1
  227. package/dist/proto/packets/open-connection-request-two.js +0 -43
  228. package/dist/proto/packets/types/address.d.ts +0 -48
  229. package/dist/proto/packets/types/address.d.ts.map +0 -1
  230. package/dist/proto/packets/types/address.js +0 -99
  231. package/dist/proto/packets/types/data-type.d.ts +0 -21
  232. package/dist/proto/packets/types/data-type.d.ts.map +0 -1
  233. package/dist/proto/packets/types/data-type.js +0 -29
  234. package/dist/proto/packets/types/frame.d.ts +0 -23
  235. package/dist/proto/packets/types/frame.d.ts.map +0 -1
  236. package/dist/proto/packets/types/frame.js +0 -94
  237. package/dist/proto/packets/types/index.d.ts.map +0 -1
  238. package/dist/proto/packets/types/magic.d.ts +0 -7
  239. package/dist/proto/packets/types/magic.d.ts.map +0 -1
  240. package/dist/proto/packets/types/magic.js +0 -14
  241. package/dist/proto/packets/types/mtu.d.ts +0 -9
  242. package/dist/proto/packets/types/mtu.d.ts.map +0 -1
  243. package/dist/proto/packets/types/mtu.js +0 -18
  244. package/dist/proto/packets/types/sys-address.d.ts +0 -11
  245. package/dist/proto/packets/types/sys-address.d.ts.map +0 -1
  246. package/dist/proto/packets/types/sys-address.js +0 -32
  247. package/dist/proto/packets/unconnected-ping.d.ts +0 -7
  248. package/dist/proto/packets/unconnected-ping.d.ts.map +0 -1
  249. package/dist/proto/packets/unconnected-ping.js +0 -38
  250. package/dist/proto/packets/unconnected-pong.d.ts +0 -8
  251. package/dist/proto/packets/unconnected-pong.d.ts.map +0 -1
  252. package/dist/proto/packets/unconnected-pong.js +0 -43
  253. package/dist/proto/types/advertisement.d.ts.map +0 -1
  254. package/dist/proto/types/index.d.ts +0 -3
  255. package/dist/proto/types/index.d.ts.map +0 -1
  256. package/dist/proto/types/valid.d.ts +0 -4
  257. package/dist/proto/types/valid.d.ts.map +0 -1
  258. package/dist/server/server-events.d.ts +0 -9
  259. package/dist/server/server-events.d.ts.map +0 -1
  260. package/dist/server/server-options.d.ts +0 -26
  261. package/dist/server/server-options.d.ts.map +0 -1
  262. package/dist/server/server-options.js +0 -20
  263. package/dist/tests/client.d.ts +0 -2
  264. package/dist/tests/client.d.ts.map +0 -1
  265. package/dist/tests/client.js +0 -15
  266. package/dist/tests/localhost.d.ts +0 -2
  267. package/dist/tests/localhost.d.ts.map +0 -1
  268. package/dist/tests/localhost.js +0 -34
  269. package/dist/tests/server.d.ts +0 -2
  270. package/dist/tests/server.d.ts.map +0 -1
  271. package/dist/tests/server.js +0 -32
  272. package/dist/tests/test.d.ts +0 -2
  273. package/dist/tests/test.d.ts.map +0 -1
  274. package/dist/tests/test.js +0 -49
  275. package/dist/utils/Logger.d.ts.map +0 -1
  276. package/dist/utils/decorators.d.ts +0 -2
  277. package/dist/utils/decorators.d.ts.map +0 -1
  278. package/dist/utils/decorators.js +0 -17
  279. package/dist/utils/index.d.ts +0 -2
  280. package/dist/utils/index.d.ts.map +0 -1
  281. /package/dist/client/{client-events.js → types/client-events.js} +0 -0
  282. /package/dist/{proto/types/valid.js → server/types/connection-events.js} +0 -0
  283. /package/dist/server/{server-events.js → types/server-events.js} +0 -0
  284. /package/dist/{utils/Logger.js → shared/logger.js} +0 -0
  285. /package/dist/{proto → shared/proto}/enums/reliability.d.ts +0 -0
  286. /package/dist/{proto → shared/proto}/enums/reliability.js +0 -0
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("reflect-metadata");
4
- const client_1 = require("../client");
5
- const clients = [];
6
- if (process.argv[2] === "server") {
7
- setInterval(() => {
8
- const client = new client_1.Client({
9
- address: "127.0.0.1",
10
- port: 19132,
11
- mtuSize: 1492,
12
- debug: false,
13
- });
14
- clients.push(client);
15
- console.time(`Connection ${clients.length}`);
16
- client.connect().then((ad) => {
17
- console.log(ad);
18
- console.timeEnd(`Connection ${clients.length}`);
19
- });
20
- }, 4);
21
- }
22
- else {
23
- const client = new client_1.Client({
24
- address: "127.0.0.1",
25
- port: 19132,
26
- mtuSize: 1492,
27
- debug: false,
28
- });
29
- console.time("Connection");
30
- client.connect().then((ad) => {
31
- console.log(ad);
32
- console.timeEnd("Connection");
33
- });
34
- }
@@ -1,2 +0,0 @@
1
- import "reflect-metadata";
2
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/tests/server.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("reflect-metadata");
4
- const server_1 = require("../server/server");
5
- const utils_1 = require("../utils");
6
- utils_1.Logger.disabled = false;
7
- utils_1.Logger.debugEnabled = false;
8
- const server = new server_1.Server({
9
- port: 19132,
10
- host: "0.0.0.0",
11
- });
12
- server.start();
13
- server.on("connect", (connection) => {
14
- utils_1.Logger.info(`Connection from ${connection.remoteInfo.address}:${connection.remoteInfo.port} established in ${connection.getConnectionTime()} ms`);
15
- connection.on("encapsulated", (packet) => {
16
- utils_1.Logger.info(`Received Encapsulated packet: ${packet.toString("hex")}`);
17
- });
18
- });
19
- let closingState = false;
20
- let attempt = 0;
21
- process.on("SIGINT", () => {
22
- if (!closingState) {
23
- closingState = true;
24
- server.close();
25
- }
26
- attempt++;
27
- // We may be desperate here
28
- if (attempt > 2) {
29
- process.exit(0);
30
- }
31
- return false;
32
- });
@@ -1,2 +0,0 @@
1
- import "reflect-metadata";
2
- //# sourceMappingURL=test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/tests/test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("reflect-metadata");
4
- const client_1 = require("../client/client");
5
- const utils_1 = require("../utils");
6
- const client = new client_1.Client({
7
- address: "hivebedrock.network",
8
- port: 19132,
9
- protocolVersion: 11,
10
- debug: false,
11
- });
12
- client.on("connect", () => {
13
- console.log("Connected to server");
14
- });
15
- console.time("connect");
16
- client
17
- .connect()
18
- .then((advertisement) => {
19
- console.log(advertisement);
20
- console.timeEnd("connect");
21
- })
22
- .catch((err) => {
23
- console.error(err);
24
- });
25
- let startMemory;
26
- let startTime;
27
- setInterval(() => {
28
- console.clear();
29
- if (!startMemory) {
30
- startMemory = process.memoryUsage();
31
- startTime = new Date().toLocaleString();
32
- }
33
- const currentMemory = process.memoryUsage();
34
- utils_1.Logger._log(`
35
- §e${startTime}§r
36
- §aHeap Used: ${formatMemory(currentMemory.heapUsed)} (Δ ${formatMemoryDiff(currentMemory.heapUsed, startMemory.heapUsed)})§r
37
- §7External: ${formatMemory(currentMemory.external)} (Δ ${formatMemoryDiff(currentMemory.external, startMemory.external)})§r
38
- §7ArrayBuffers: ${formatMemory(currentMemory.arrayBuffers)} (Δ ${formatMemoryDiff(currentMemory.arrayBuffers, startMemory.arrayBuffers)})§r
39
- §7Total Heap: ${formatMemory(currentMemory.heapTotal)} (Δ ${formatMemoryDiff(currentMemory.heapTotal, startMemory.heapTotal)})§r
40
- `);
41
- }, 250);
42
- function formatMemory(bytes) {
43
- return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
44
- }
45
- function formatMemoryDiff(current, start) {
46
- const diff = current - start;
47
- const sign = diff >= 0 ? "+" : "";
48
- return `${sign}${(diff / 1024 / 1024).toFixed(2)} MB`;
49
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/utils/Logger.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAuC/E,QAAA,MAAM,MAAM;;;;;;;;;kBAMG,OAAO,EAAE,GAAG,IAAI;mBAIf,OAAO,EAAE,GAAG,IAAI;kBAIjB,OAAO,EAAE,GAAG,IAAI;mBAIf,OAAO,EAAE,GAAG,IAAI;kBAKjB,OAAO,EAAE,GAAG,IAAI;YAItB,MAAM;iBAOD,OAAO,EAAE,GAAG,IAAI;kBAKf,OAAO,EAAE,GAAG,IAAI;sBAIZ,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE;eAmCvC,IAAI;CAKf,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function measureExecutionTime(_target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
2
- //# sourceMappingURL=decorators.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/utils/decorators.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,kBAAkB,sBAkB9B"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.measureExecutionTime = measureExecutionTime;
4
- function measureExecutionTime(_target, propertyKey, descriptor) {
5
- const originalMethod = descriptor.value;
6
- descriptor.value = async function (...args) {
7
- const start = performance.now();
8
- const result = await originalMethod.apply(this, args);
9
- const end = performance.now();
10
- const duration = end - start;
11
- if (this.options?.debug) {
12
- console.log(`${propertyKey} execution time: ${duration.toFixed(2)}ms`);
13
- }
14
- return result;
15
- };
16
- return descriptor;
17
- }
@@ -1,2 +0,0 @@
1
- export * from "./Logger";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
File without changes