diff --git a/src/hono-base.ts b/src/hono-base.ts index 3e040da53..c141a0db6 100644 --- a/src/hono-base.ts +++ b/src/hono-base.ts @@ -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) } diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 000000000..27d04ea36 --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1,4 @@ +/** + * Constant used to mark a composed handler. + */ +export const COMPOSED_HANDLER = '__COMPOSED_HANDLER' diff --git a/src/utils/handler.ts b/src/utils/handler.ts index bdf4d7d58..295496870 100644 --- a/src/utils/handler.ts +++ b/src/utils/handler.ts @@ -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 => {