Skip to content

Commit

Permalink
fix(hono-base): don't use Symbol for COMPOSED_HANDLER
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Dec 26, 2024
1 parent b1335f9 commit faadeb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/hono-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@ import type {
RouterRoute,
Schema,
} from './types'
import { COMPOSED_HANDLER } from './utils/constants'
import { getPath, getPathNoStrict, mergePath } from './utils/url'

/**
* Symbol used to mark a composed handler.
*/
export const COMPOSED_HANDLER = Symbol('composedHandler')

const notFoundHandler = (c: Context) => {
return c.text('404 Not Found', 404)
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Constant used to mark a composed handler.
*/
export const COMPOSED_HANDLER = '__COMPOSED_HANDLER'
2 changes: 1 addition & 1 deletion src/utils/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Handler utility.
*/

import { COMPOSED_HANDLER } from '../hono-base'
import { COMPOSED_HANDLER } from './constants'

export const isMiddleware = (handler: Function) => handler.length > 1
export const findTargetHandler = (handler: Function): Function => {
Expand Down

0 comments on commit faadeb1

Please sign in to comment.