tezx 4.0.8 → 4.0.9

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.
@@ -4,7 +4,7 @@ exports.Router = void 0;
4
4
  const url_js_1 = require("../utils/url.js");
5
5
  class Router {
6
6
  router;
7
- route = [];
7
+ routes = [];
8
8
  staticFile = Object.create(null);
9
9
  basePath;
10
10
  constructor({ basePath = "/" } = {}) {
@@ -150,7 +150,7 @@ class Router {
150
150
  #addRoute(method, path, handlers) {
151
151
  let pattern = `/${(0, url_js_1.sanitizePathSplitBasePath)(this.basePath, path).join("/")}`;
152
152
  this.router?.addRoute?.(method, pattern, handlers);
153
- this.route.push({
153
+ this.routes.push({
154
154
  method: method,
155
155
  pattern: pattern,
156
156
  handlers: handlers,
@@ -186,7 +186,7 @@ class Router {
186
186
  if (!(router instanceof Router)) {
187
187
  throw new Error("Router instance is required.");
188
188
  }
189
- router.route.forEach((r) => {
189
+ router.routes.forEach((r) => {
190
190
  this.#addRoute(r?.method, `/${(0, url_js_1.sanitizePathSplitBasePath)(path, r?.pattern).join("/")}`, r?.handlers);
191
191
  });
192
192
  Object.assign(this.staticFile, router.staticFile);
package/cjs/index.js CHANGED
@@ -5,7 +5,7 @@ const router_js_1 = require("./core/router.js");
5
5
  Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return router_js_1.Router; } });
6
6
  const server_js_1 = require("./core/server.js");
7
7
  Object.defineProperty(exports, "TezX", { enumerable: true, get: function () { return server_js_1.TezX; } });
8
- exports.version = "4.0.8";
8
+ exports.version = "4.0.9";
9
9
  exports.default = {
10
10
  Router: router_js_1.Router,
11
11
  TezX: server_js_1.TezX,
package/core/router.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare class Router<T extends Record<string, any> = {}> {
23
23
  /** Internal route registry to hold all routes */
24
24
  protected router?: RouteRegistry;
25
25
  /** Array tracking registered routes and their handlers */
26
- protected route: {
26
+ protected routes: {
27
27
  method: string;
28
28
  pattern: string;
29
29
  handlers: HandlerType;
package/core/router.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { sanitizePathSplitBasePath } from "../utils/url.js";
2
2
  export class Router {
3
3
  router;
4
- route = [];
4
+ routes = [];
5
5
  staticFile = Object.create(null);
6
6
  basePath;
7
7
  constructor({ basePath = "/" } = {}) {
@@ -147,7 +147,7 @@ export class Router {
147
147
  #addRoute(method, path, handlers) {
148
148
  let pattern = `/${sanitizePathSplitBasePath(this.basePath, path).join("/")}`;
149
149
  this.router?.addRoute?.(method, pattern, handlers);
150
- this.route.push({
150
+ this.routes.push({
151
151
  method: method,
152
152
  pattern: pattern,
153
153
  handlers: handlers,
@@ -183,7 +183,7 @@ export class Router {
183
183
  if (!(router instanceof Router)) {
184
184
  throw new Error("Router instance is required.");
185
185
  }
186
- router.route.forEach((r) => {
186
+ router.routes.forEach((r) => {
187
187
  this.#addRoute(r?.method, `/${sanitizePathSplitBasePath(path, r?.pattern).join("/")}`, r?.handlers);
188
188
  });
189
189
  Object.assign(this.staticFile, router.staticFile);
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Router } from "./core/router.js";
2
2
  import { TezX } from "./core/server.js";
3
3
  export { Router, TezX };
4
- export let version = "4.0.8";
4
+ export let version = "4.0.9";
5
5
  export default {
6
6
  Router,
7
7
  TezX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tezx",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "description": "TezX is a modern, ultra-lightweight, and high-performance JavaScript framework built specifically for Bun. It provides a minimal yet powerful API, seamless environment management, and a high-concurrency HTTP engine for building fast, scalable web applications.",
5
5
  "type": "module",
6
6
  "main": "cjs/index.js",