@@ -142,3 +142,3 @@ var __defProp = Object.defineProperty; | ||
| } | ||
| subApp.#addRoute(r.method, r.path, handler); | ||
| subApp.#addRoute(r.method, r.path, handler, r.basePath); | ||
| }); | ||
@@ -281,6 +281,11 @@ return this; | ||
| } | ||
| #addRoute(method, path, handler) { | ||
| #addRoute(method, path, handler, baseRoutePath) { | ||
| method = method.toUpperCase(); | ||
| path = (0, import_url.mergePath)(this._basePath, path); | ||
| const r = { basePath: this._basePath, path, method, handler }; | ||
| const r = { | ||
| basePath: baseRoutePath !== void 0 ? (0, import_url.mergePath)(this._basePath, baseRoutePath) : this._basePath, | ||
| path, | ||
| method, | ||
| handler | ||
| }; | ||
| this.router.add(method, path, [handler, r]); | ||
@@ -287,0 +292,0 @@ this.routes.push(r); |
@@ -121,3 +121,3 @@ // src/hono-base.ts | ||
| } | ||
| subApp.#addRoute(r.method, r.path, handler); | ||
| subApp.#addRoute(r.method, r.path, handler, r.basePath); | ||
| }); | ||
@@ -260,6 +260,11 @@ return this; | ||
| } | ||
| #addRoute(method, path, handler) { | ||
| #addRoute(method, path, handler, baseRoutePath) { | ||
| method = method.toUpperCase(); | ||
| path = mergePath(this._basePath, path); | ||
| const r = { basePath: this._basePath, path, method, handler }; | ||
| const r = { | ||
| basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath, | ||
| path, | ||
| method, | ||
| handler | ||
| }; | ||
| this.router.add(method, path, [handler, r]); | ||
@@ -266,0 +271,0 @@ this.routes.push(r); |
@@ -44,4 +44,4 @@ import type { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from '../utils/html'; | ||
| } | ||
| export declare const jsx: (tag: string | Function, props: Props | null, ...children: (string | number | HtmlEscapedString)[]) => JSXNode; | ||
| export declare const jsxFn: (tag: string | Function, props: Props, children: (string | number | HtmlEscapedString)[]) => JSXNode; | ||
| export declare const jsx: (tag: string | Function, props: Props | null, ...children: Child[]) => JSXNode; | ||
| export declare const jsxFn: (tag: string | Function, props: Props, children: Child[]) => JSXNode; | ||
| export declare const shallowEqual: (a: Props, b: Props) => boolean; | ||
@@ -48,0 +48,0 @@ export type MemorableFC<T> = FC<T> & { |
@@ -26,3 +26,3 @@ /** | ||
| isValidElement: (element: unknown) => element is import("./base").JSXNode; | ||
| createElement: (tag: string | Function, props: import("./base").Props | null, ...children: (string | number | import("../utils/html").HtmlEscapedString)[]) => import("./base").JSXNode; | ||
| createElement: (tag: string | Function, props: import("./base").Props | null, ...children: import("./base").Child[]) => import("./base").JSXNode; | ||
| cloneElement: <T extends import("./base").JSXNode | import("./base").JSX.Element>(element: T, props: Partial<import("./base").Props>, ...children: import("./base").Child[]) => T; | ||
@@ -29,0 +29,0 @@ ErrorBoundary: import("./base").FC<import("./types").PropsWithChildren<{ |
+1
-1
| { | ||
| "name": "hono", | ||
| "version": "4.12.19", | ||
| "version": "4.12.20", | ||
| "description": "Web framework built on Web Standards", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
1400453
0.01%36749
0.03%