Comparing version 1.16.7 to 1.16.8
@@ -37,3 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
const handlers = Array.isArray(_handlers) ? _handlers : [_handlers]; | ||
if (handlers[handlers.length - 1] !== ctx.handler) { | ||
if (!handlers.includes(ctx.handler)) { | ||
console.warn(`[fib-app] return of customizeApiRoute(ctx) must includes ctx.handler, but not found now. we will add it at the end of handlers automatically.`); | ||
handlers.push(ctx.handler); | ||
} | ||
if (!_customizeApiRoute.allowCustomizePostApiRoute && handlers[handlers.length - 1] !== ctx.handler) { | ||
throw new Error(`[fib-app] customizeApiRoute should return the last handler as the final handler, but got ${handlers[handlers.length - 1].name} instead of ${ctx.handler.name}`); | ||
@@ -40,0 +44,0 @@ } |
{ | ||
"name": "fib-app", | ||
"version": "1.16.7", | ||
"version": "1.16.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
@@ -457,2 +457,4 @@ /// <reference types="fib-rpc" /> | ||
})): ItOrArray<typeof context['handler']>; | ||
} & { | ||
allowCustomizePostApiRoute?: boolean; | ||
}; | ||
@@ -459,0 +461,0 @@ } |
194465
4407