(callback: AxeFunction)
| 56 | }; |
| 57 | |
| 58 | export const toPhaseFunction = (callback: AxeFunction): PhaseFunction => { |
| 59 | if (isMiddlewareFunction(callback)) { |
| 60 | return promisify((context: IContext, next: any) => |
| 61 | (callback as MiddlewareFunction)( |
| 62 | context.req.original, |
| 63 | context.res.original, |
| 64 | next, |
| 65 | ), |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | if (isHandlerFunction(callback)) { |
| 70 | return (context: IContext) => |
| 71 | (callback as HandlerFunction)(context.req, context.res); |
| 72 | } |
| 73 | |
| 74 | return callback as PhaseFunction; |
| 75 | }; |
nothing calls this directly
no test coverage detected