MCPcopy Create free account
hub / github.com/axe-api/axe-api / resolveMiddlewares

Function resolveMiddlewares

packages/axe-api/src/Services/ConverterService.ts:30–44  ·  view source on GitHub ↗
(
  args: GeneralFunction[],
)

Source from the content-addressed store, hash-verified

28};
29
30export const resolveMiddlewares = (
31 args: GeneralFunction[],
32): MiddlewareResolution => {
33 const middlewares: MiddlewareFunction[] = args.slice(
34 0,
35 -1,
36 ) as MiddlewareFunction[];
37
38 const handler: HandlerFunction = args.at(-1) as HandlerFunction;
39
40 return {
41 middlewares,
42 handler,
43 };
44};
45
46export const isMiddlewareFunction = (callback: any): boolean => {
47 return callback.length === 3;

Callers 5

getMethod · 0.90
postMethod · 0.90
putMethod · 0.90
patchMethod · 0.90
deleteMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected