tezx 1.0.60 → 1.0.62

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/adapter/node.js CHANGED
@@ -4,7 +4,7 @@ import { Context } from "../core/context.js";
4
4
  export function nodeAdapter(TezX, options = {}) {
5
5
  function listen(...arg) {
6
6
  let ssl = options?.enableSSL;
7
- import(ssl ? "node:https" : 'node:http')
7
+ import(ssl ? "node:https" : "node:http")
8
8
  .then((r) => {
9
9
  GlobalConfig.adapter = "node";
10
10
  let server = r.createServer(options, async (req, res) => {
@@ -39,11 +39,10 @@ export function nodeAdapter(TezX, options = {}) {
39
39
  if (!(response instanceof Response)) {
40
40
  throw new Error("Invalid response from TezX.serve");
41
41
  }
42
- const headers = Object.fromEntries(await response.headers.entries());
43
42
  if (statusText) {
44
43
  res.statusMessage = statusText;
45
44
  }
46
- res.writeHead(response.status, headers);
45
+ res.writeHead(response.status, [...response.headers.entries()]);
47
46
  const { Readable } = await import("node:stream");
48
47
  if (response.body instanceof Readable) {
49
48
  return response.body.pipe(res);
@@ -61,7 +60,9 @@ export function nodeAdapter(TezX, options = {}) {
61
60
  const port = typeof arg[0] === "function" ? undefined : arg[0];
62
61
  const callback = typeof arg[0] === "function" ? arg[0] : arg[1];
63
62
  server.listen(options?.unix || port || 0, () => {
64
- const protocol = ssl ? "\x1b[1;35mhttps\x1b[0m" : "\x1b[1;34mhttp\x1b[0m";
63
+ const protocol = ssl
64
+ ? "\x1b[1;35mhttps\x1b[0m"
65
+ : "\x1b[1;34mhttp\x1b[0m";
65
66
  const address = server.address();
66
67
  const message = typeof address === "string"
67
68
  ? `\x1b[1mNodeJS TezX Server running at unix://${address}\x1b[0m`
@@ -7,7 +7,7 @@ const context_js_1 = require("../core/context.js");
7
7
  function nodeAdapter(TezX, options = {}) {
8
8
  function listen(...arg) {
9
9
  let ssl = options?.enableSSL;
10
- Promise.resolve(`${ssl ? "node:https" : 'node:http'}`).then(s => require(s)).then((r) => {
10
+ Promise.resolve(`${ssl ? "node:https" : "node:http"}`).then(s => require(s)).then((r) => {
11
11
  config_js_1.GlobalConfig.adapter = "node";
12
12
  let server = r.createServer(options, async (req, res) => {
13
13
  let address = {};
@@ -41,11 +41,10 @@ function nodeAdapter(TezX, options = {}) {
41
41
  if (!(response instanceof Response)) {
42
42
  throw new Error("Invalid response from TezX.serve");
43
43
  }
44
- const headers = Object.fromEntries(await response.headers.entries());
45
44
  if (statusText) {
46
45
  res.statusMessage = statusText;
47
46
  }
48
- res.writeHead(response.status, headers);
47
+ res.writeHead(response.status, [...response.headers.entries()]);
49
48
  const { Readable } = await Promise.resolve().then(() => require("node:stream"));
50
49
  if (response.body instanceof Readable) {
51
50
  return response.body.pipe(res);
@@ -63,7 +62,9 @@ function nodeAdapter(TezX, options = {}) {
63
62
  const port = typeof arg[0] === "function" ? undefined : arg[0];
64
63
  const callback = typeof arg[0] === "function" ? arg[0] : arg[1];
65
64
  server.listen(options?.unix || port || 0, () => {
66
- const protocol = ssl ? "\x1b[1;35mhttps\x1b[0m" : "\x1b[1;34mhttp\x1b[0m";
65
+ const protocol = ssl
66
+ ? "\x1b[1;35mhttps\x1b[0m"
67
+ : "\x1b[1;34mhttp\x1b[0m";
67
68
  const address = server.address();
68
69
  const message = typeof address === "string"
69
70
  ? `\x1b[1mNodeJS TezX Server running at unix://${address}\x1b[0m`
@@ -80,6 +80,13 @@ class HeadersParser {
80
80
  }
81
81
  return obj;
82
82
  }
83
+ toJSON() {
84
+ const obj = {};
85
+ for (const [key, value] of this.headers.entries()) {
86
+ obj[key] = Array.isArray(value) ? value.join(", ") : value;
87
+ }
88
+ return obj;
89
+ }
83
90
  }
84
91
  exports.HeadersParser = HeadersParser;
85
92
  Object.defineProperty(HeadersParser, "name", { value: "Headers" });
@@ -54,6 +54,9 @@ class Request {
54
54
  forEach: function forEach(callback) {
55
55
  return requestHeaders.forEach(callback);
56
56
  },
57
+ toJSON() {
58
+ return requestHeaders.toJSON();
59
+ },
57
60
  toObject: function toObject() {
58
61
  return requestHeaders.toObject();
59
62
  },
@@ -76,18 +76,24 @@ class TezX extends router_js_1.Router {
76
76
  }
77
77
  return null;
78
78
  }
79
- #createHandler(middlewares, finalCallback) {
79
+ #createHandler(middlewares) {
80
80
  return async (ctx) => {
81
+ let response = undefined;
81
82
  let index = 0;
82
- const next = async () => {
83
- if (index < middlewares.length) {
84
- return await middlewares[index++](ctx, next);
83
+ let next = async () => {
84
+ const currentMiddleware = middlewares[index++];
85
+ let result = await currentMiddleware?.(ctx, next);
86
+ if (result instanceof Response) {
87
+ ctx.res = result;
88
+ response = ctx.res;
89
+ return result;
85
90
  }
86
- else {
87
- return await finalCallback(ctx);
91
+ if (result) {
92
+ response = result;
93
+ return response;
88
94
  }
89
95
  };
90
- const response = await next();
96
+ await next();
91
97
  if (response instanceof Response) {
92
98
  return response;
93
99
  }
@@ -95,10 +101,10 @@ class TezX extends router_js_1.Router {
95
101
  return response;
96
102
  }
97
103
  if (!response && !ctx.body) {
98
- throw new Error(`Handler did not return a response or next() was not called. Path: ${ctx.pathname}, Method: ${ctx.method}`);
104
+ throw new Error(`Handler failed: Middleware chain incomplete or response missing. Did you forget ${colors_js_1.COLORS.bgRed} 'await next()' ${colors_js_1.COLORS.reset} or to return a response? ${colors_js_1.COLORS.bgCyan} Path: ${ctx.pathname}, Method: ${ctx.method} ${colors_js_1.COLORS.reset}`);
99
105
  }
100
106
  const resBody = response || ctx.body;
101
- return ctx.send(resBody, ctx.headers.toObject());
107
+ return ctx.send(resBody, ctx.headers.toJSON());
102
108
  };
103
109
  }
104
110
  #findMiddleware(pathname) {
@@ -141,21 +147,18 @@ class TezX extends router_js_1.Router {
141
147
  let middlewares = this.#findMiddleware(resolvePath);
142
148
  ctx.env = this.env;
143
149
  try {
144
- let callback = async (ctx) => {
145
- const find = this.findRoute(ctx.req.method, resolvePath);
146
- if (find?.callback) {
147
- ctx.params = find.params;
148
- const callback = find.callback;
149
- let middlewares = find.middlewares;
150
- return (await this.#createHandler(middlewares, callback)(ctx));
151
- }
152
- else {
153
- let res = (await config_js_1.GlobalConfig.notFound(ctx));
154
- ctx.setStatus = res.status;
155
- return res;
156
- }
157
- };
158
- let response = await this.#createHandler([...this.triMiddlewares.middlewares, ...middlewares], callback)(ctx);
150
+ let combine = [...this.triMiddlewares.middlewares, ...middlewares];
151
+ const find = this.findRoute(ctx.req.method, resolvePath);
152
+ if (find?.callback) {
153
+ ctx.params = find.params;
154
+ const callback = find.callback;
155
+ let routeMiddlewares = find.middlewares || [];
156
+ combine.push(...routeMiddlewares, callback);
157
+ }
158
+ else {
159
+ combine.push(config_js_1.GlobalConfig.notFound);
160
+ }
161
+ let response = await this.#createHandler(combine)(ctx);
159
162
  if (ctx.wsProtocol) {
160
163
  if (typeof response == "function") {
161
164
  return {
package/cjs/index.js CHANGED
@@ -7,4 +7,4 @@ var server_js_1 = require("./core/server.js");
7
7
  Object.defineProperty(exports, "TezX", { enumerable: true, get: function () { return server_js_1.TezX; } });
8
8
  var params_js_1 = require("./utils/params.js");
9
9
  Object.defineProperty(exports, "useParams", { enumerable: true, get: function () { return params_js_1.useParams; } });
10
- exports.version = "1.0.60";
10
+ exports.version = "1.0.62";
@@ -15,10 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.detectBot = exports.cors = void 0;
18
+ __exportStar(require("./basicAuth.js"), exports);
18
19
  var cors_js_1 = require("./cors.js");
19
20
  Object.defineProperty(exports, "cors", { enumerable: true, get: function () { return cors_js_1.cors; } });
20
21
  var detectBot_js_1 = require("./detectBot.js");
21
22
  Object.defineProperty(exports, "detectBot", { enumerable: true, get: function () { return detectBot_js_1.detectBot; } });
23
+ __exportStar(require("./detectLocale.js"), exports);
22
24
  __exportStar(require("./i18nMiddleware.js"), exports);
23
25
  __exportStar(require("./lazyLoadModules.js"), exports);
24
26
  __exportStar(require("./logger.js"), exports);
@@ -26,8 +28,7 @@ __exportStar(require("./pagination.js"), exports);
26
28
  __exportStar(require("./powered-by.js"), exports);
27
29
  __exportStar(require("./rateLimiter.js"), exports);
28
30
  __exportStar(require("./request-id.js"), exports);
31
+ __exportStar(require("./requestTimeout.js"), exports);
29
32
  __exportStar(require("./sanitizeHeader.js"), exports);
30
33
  __exportStar(require("./secureHeaders.js"), exports);
31
34
  __exportStar(require("./xssProtection.js"), exports);
32
- __exportStar(require("./basicAuth.js"), exports);
33
- __exportStar(require("./detectLocale.js"), exports);
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestTimeout = void 0;
4
+ const config_1 = require("../core/config");
5
+ const requestTimeout = (options) => {
6
+ const { getTimeout, onTimeout = (ctx) => {
7
+ ctx.setStatus = 504;
8
+ ctx.body = { error: "Request timed out." };
9
+ }, logTimeoutEvent = (ctx, error) => {
10
+ config_1.GlobalConfig.debugging.warn(`[TIMEOUT] ${error.message}: ${ctx.method} ${ctx.path}`);
11
+ }, cleanup = () => {
12
+ }, } = options;
13
+ return async (ctx, next) => {
14
+ let timeoutId = null;
15
+ try {
16
+ const timeout = getTimeout(ctx);
17
+ const timeoutPromise = new Promise((_, reject) => {
18
+ timeoutId = setTimeout(() => {
19
+ const timeoutError = new Error("Request timed out.");
20
+ logTimeoutEvent(ctx, timeoutError);
21
+ reject(timeoutError);
22
+ }, timeout);
23
+ });
24
+ return await Promise.race([next(), timeoutPromise]);
25
+ }
26
+ catch (error) {
27
+ if (error.message === "Request timed out.") {
28
+ onTimeout(ctx, error);
29
+ }
30
+ else {
31
+ throw error;
32
+ }
33
+ }
34
+ finally {
35
+ if (timeoutId) {
36
+ clearTimeout(timeoutId);
37
+ }
38
+ cleanup(ctx);
39
+ }
40
+ };
41
+ };
42
+ exports.requestTimeout = requestTimeout;
package/cjs/ws/deno.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DenoTransport = void 0;
4
4
  class DenoTransport {
5
5
  async upgrade(ctx, event, options) {
6
- const { socket, response } = (Deno).upgradeWebSocket(ctx.req.rawRequest, {
6
+ const { socket, response } = Deno.upgradeWebSocket(ctx.req.rawRequest, {
7
7
  protocol: options.protocol,
8
8
  idleTimeout: options.idleTimeout,
9
9
  });
package/core/header.d.ts CHANGED
@@ -68,4 +68,10 @@ export declare class HeadersParser {
68
68
  * @returns A record of headers where single-value headers are returned as a string.
69
69
  */
70
70
  toObject(): Record<string, string | string[]>;
71
+ /**
72
+ * Converts headers to a JSON-safe plain object (only single string values).
73
+ * Multi-value headers are joined by commas.
74
+ * @returns A record of headers with string values.
75
+ */
76
+ toJSON(): Record<string, string>;
71
77
  }
package/core/header.js CHANGED
@@ -77,5 +77,12 @@ export class HeadersParser {
77
77
  }
78
78
  return obj;
79
79
  }
80
+ toJSON() {
81
+ const obj = {};
82
+ for (const [key, value] of this.headers.entries()) {
83
+ obj[key] = Array.isArray(value) ? value.join(", ") : value;
84
+ }
85
+ return obj;
86
+ }
80
87
  }
81
88
  Object.defineProperty(HeadersParser, "name", { value: "Headers" });
package/core/request.d.ts CHANGED
@@ -129,6 +129,12 @@ export declare class Request {
129
129
  * });
130
130
  */
131
131
  forEach: (callback: (value: string[], key: string) => void) => void;
132
+ /**
133
+ * Converts headers to a JSON-safe plain object (only single string values).
134
+ * Multi-value headers are joined by commas.
135
+ * @returns A record of headers with string values.
136
+ */
137
+ toJSON(): Record<string, string>;
132
138
  /**
133
139
  * Converts all headers into a plain JavaScript object.
134
140
  * Single-value headers are represented as a string, and multi-value headers as an array.
package/core/request.js CHANGED
@@ -51,6 +51,9 @@ export class Request {
51
51
  forEach: function forEach(callback) {
52
52
  return requestHeaders.forEach(callback);
53
53
  },
54
+ toJSON() {
55
+ return requestHeaders.toJSON();
56
+ },
54
57
  toObject: function toObject() {
55
58
  return requestHeaders.toObject();
56
59
  },
package/core/router.d.ts CHANGED
@@ -5,7 +5,7 @@ export type ctx<T extends Record<string, any> = {}> = Context<T> & T;
5
5
  export type NextCallback = () => Promise<any>;
6
6
  export type CallbackReturn = Promise<Response> | Response;
7
7
  export type Callback<T extends Record<string, any> = {}> = (ctx: ctx<T>) => CallbackReturn;
8
- export type Middleware<T extends Record<string, any> = {}> = (ctx: ctx<T>, next: NextCallback) => Promise<Response> | Response | NextCallback;
8
+ export type Middleware<T extends Record<string, any> = {}> = (ctx: ctx<T>, next: NextCallback) => Promise<Response | void> | Response | NextCallback;
9
9
  export type RouterConfig = {
10
10
  /**
11
11
  * `env` allows you to define environment variables for the router.
package/core/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getFiles } from "../utils/staticFile.js";
2
- import { sanitizePathSplit, wildcardOrOptionalParamRegex } from "../utils/url.js";
2
+ import { sanitizePathSplit, wildcardOrOptionalParamRegex, } from "../utils/url.js";
3
3
  import { GlobalConfig } from "./config.js";
4
4
  import MiddlewareConfigure, { TriMiddleware, } from "./MiddlewareConfigure.js";
5
5
  class TrieRouter {
package/core/server.js CHANGED
@@ -73,18 +73,24 @@ export class TezX extends Router {
73
73
  }
74
74
  return null;
75
75
  }
76
- #createHandler(middlewares, finalCallback) {
76
+ #createHandler(middlewares) {
77
77
  return async (ctx) => {
78
+ let response = undefined;
78
79
  let index = 0;
79
- const next = async () => {
80
- if (index < middlewares.length) {
81
- return await middlewares[index++](ctx, next);
80
+ let next = async () => {
81
+ const currentMiddleware = middlewares[index++];
82
+ let result = await currentMiddleware?.(ctx, next);
83
+ if (result instanceof Response) {
84
+ ctx.res = result;
85
+ response = ctx.res;
86
+ return result;
82
87
  }
83
- else {
84
- return await finalCallback(ctx);
88
+ if (result) {
89
+ response = result;
90
+ return response;
85
91
  }
86
92
  };
87
- const response = await next();
93
+ await next();
88
94
  if (response instanceof Response) {
89
95
  return response;
90
96
  }
@@ -92,10 +98,10 @@ export class TezX extends Router {
92
98
  return response;
93
99
  }
94
100
  if (!response && !ctx.body) {
95
- throw new Error(`Handler did not return a response or next() was not called. Path: ${ctx.pathname}, Method: ${ctx.method}`);
101
+ throw new Error(`Handler failed: Middleware chain incomplete or response missing. Did you forget ${COLORS.bgRed} 'await next()' ${COLORS.reset} or to return a response? ${COLORS.bgCyan} Path: ${ctx.pathname}, Method: ${ctx.method} ${COLORS.reset}`);
96
102
  }
97
103
  const resBody = response || ctx.body;
98
- return ctx.send(resBody, ctx.headers.toObject());
104
+ return ctx.send(resBody, ctx.headers.toJSON());
99
105
  };
100
106
  }
101
107
  #findMiddleware(pathname) {
@@ -138,21 +144,18 @@ export class TezX extends Router {
138
144
  let middlewares = this.#findMiddleware(resolvePath);
139
145
  ctx.env = this.env;
140
146
  try {
141
- let callback = async (ctx) => {
142
- const find = this.findRoute(ctx.req.method, resolvePath);
143
- if (find?.callback) {
144
- ctx.params = find.params;
145
- const callback = find.callback;
146
- let middlewares = find.middlewares;
147
- return (await this.#createHandler(middlewares, callback)(ctx));
148
- }
149
- else {
150
- let res = (await GlobalConfig.notFound(ctx));
151
- ctx.setStatus = res.status;
152
- return res;
153
- }
154
- };
155
- let response = await this.#createHandler([...this.triMiddlewares.middlewares, ...middlewares], callback)(ctx);
147
+ let combine = [...this.triMiddlewares.middlewares, ...middlewares];
148
+ const find = this.findRoute(ctx.req.method, resolvePath);
149
+ if (find?.callback) {
150
+ ctx.params = find.params;
151
+ const callback = find.callback;
152
+ let routeMiddlewares = find.middlewares || [];
153
+ combine.push(...routeMiddlewares, callback);
154
+ }
155
+ else {
156
+ combine.push(GlobalConfig.notFound);
157
+ }
158
+ let response = await this.#createHandler(combine)(ctx);
156
159
  if (ctx.wsProtocol) {
157
160
  if (typeof response == "function") {
158
161
  return {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Router } from "./core/router.js";
2
2
  export { TezX } from "./core/server.js";
3
3
  export { useParams } from "./utils/params.js";
4
- export let version = "1.0.60";
4
+ export let version = "1.0.62";
@@ -1,7 +1,9 @@
1
+ export * from "./basicAuth.js";
1
2
  export { cors } from "./cors.js";
2
3
  export type { CorsOptions } from "./cors.js";
3
4
  export { detectBot } from "./detectBot.js";
4
5
  export type { DetectBotReason } from "./detectBot.js";
6
+ export * from "./detectLocale.js";
5
7
  export * from "./i18nMiddleware.js";
6
8
  export * from "./lazyLoadModules.js";
7
9
  export * from "./logger.js";
@@ -9,8 +11,7 @@ export * from "./pagination.js";
9
11
  export * from "./powered-by.js";
10
12
  export * from "./rateLimiter.js";
11
13
  export * from "./request-id.js";
14
+ export * from "./requestTimeout.js";
12
15
  export * from "./sanitizeHeader.js";
13
16
  export * from "./secureHeaders.js";
14
17
  export * from "./xssProtection.js";
15
- export * from "./basicAuth.js";
16
- export * from "./detectLocale.js";
@@ -1,5 +1,7 @@
1
+ export * from "./basicAuth.js";
1
2
  export { cors } from "./cors.js";
2
3
  export { detectBot } from "./detectBot.js";
4
+ export * from "./detectLocale.js";
3
5
  export * from "./i18nMiddleware.js";
4
6
  export * from "./lazyLoadModules.js";
5
7
  export * from "./logger.js";
@@ -7,8 +9,7 @@ export * from "./pagination.js";
7
9
  export * from "./powered-by.js";
8
10
  export * from "./rateLimiter.js";
9
11
  export * from "./request-id.js";
12
+ export * from "./requestTimeout.js";
10
13
  export * from "./sanitizeHeader.js";
11
14
  export * from "./secureHeaders.js";
12
15
  export * from "./xssProtection.js";
13
- export * from "./basicAuth.js";
14
- export * from "./detectLocale.js";
@@ -0,0 +1,26 @@
1
+ import { Context } from "../core/context";
2
+ import { CallbackReturn, Middleware } from "../core/router";
3
+ type TimeoutOptions = {
4
+ /**
5
+ * ⏳ Function to dynamically determine the timeout duration (in milliseconds).
6
+ */
7
+ getTimeout: (ctx: Context) => number;
8
+ /**
9
+ * 🚫 Custom function to handle timeout errors.
10
+ */
11
+ onTimeout?: (ctx: Context, error: Error) => CallbackReturn;
12
+ /**
13
+ * 📝 Logging function for timeout events.
14
+ */
15
+ logTimeoutEvent?: (ctx: Context, error: Error) => void;
16
+ /**
17
+ * 🛠️ Custom function to clean up resources after a timeout.
18
+ */
19
+ cleanup?: (ctx: Context) => void;
20
+ };
21
+ /**
22
+ * Middleware to enforce fully dynamic request timeouts.
23
+ * @param options - Custom options for dynamic timeout handling.
24
+ */
25
+ export declare const requestTimeout: (options: TimeoutOptions) => Middleware;
26
+ export {};
@@ -0,0 +1,38 @@
1
+ import { GlobalConfig } from "../core/config";
2
+ export const requestTimeout = (options) => {
3
+ const { getTimeout, onTimeout = (ctx) => {
4
+ ctx.setStatus = 504;
5
+ ctx.body = { error: "Request timed out." };
6
+ }, logTimeoutEvent = (ctx, error) => {
7
+ GlobalConfig.debugging.warn(`[TIMEOUT] ${error.message}: ${ctx.method} ${ctx.path}`);
8
+ }, cleanup = () => {
9
+ }, } = options;
10
+ return async (ctx, next) => {
11
+ let timeoutId = null;
12
+ try {
13
+ const timeout = getTimeout(ctx);
14
+ const timeoutPromise = new Promise((_, reject) => {
15
+ timeoutId = setTimeout(() => {
16
+ const timeoutError = new Error("Request timed out.");
17
+ logTimeoutEvent(ctx, timeoutError);
18
+ reject(timeoutError);
19
+ }, timeout);
20
+ });
21
+ return await Promise.race([next(), timeoutPromise]);
22
+ }
23
+ catch (error) {
24
+ if (error.message === "Request timed out.") {
25
+ onTimeout(ctx, error);
26
+ }
27
+ else {
28
+ throw error;
29
+ }
30
+ }
31
+ finally {
32
+ if (timeoutId) {
33
+ clearTimeout(timeoutId);
34
+ }
35
+ cleanup(ctx);
36
+ }
37
+ };
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tezx",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "description": "TezX is a high-performance, lightweight JavaScript framework designed for speed, scalability, and flexibility. It enables efficient routing, middleware management, and static file serving with minimal configuration. Fully compatible with Node.js, Deno, and Bun.",
5
5
  "main": "cjs/index.js",
6
6
  "module": "index.js",
@@ -19,6 +19,7 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/tezxjs/TezX/issues"
21
21
  },
22
+ "homepage": "https://github.com/tezxjs/TezX/issues#readme",
22
23
  "exports": {
23
24
  ".": {
24
25
  "import": "./index.js",
@@ -51,7 +52,6 @@
51
52
  "default": "./ws/index.js"
52
53
  }
53
54
  },
54
- "homepage": "https://github.com/tezxjs/TezX",
55
55
  "files": [
56
56
  "adapter/",
57
57
  "cjs/",
package/ws/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export class DenoTransport {
2
2
  async upgrade(ctx, event, options) {
3
- const { socket, response } = (Deno).upgradeWebSocket(ctx.req.rawRequest, {
3
+ const { socket, response } = Deno.upgradeWebSocket(ctx.req.rawRequest, {
4
4
  protocol: options.protocol,
5
5
  idleTimeout: options.idleTimeout,
6
6
  });