next-pipe-middleware
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -11,5 +10,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pipeMiddleware = void 0; | ||
const pipeMiddleware = (req, res, middlewares) => __awaiter(void 0, void 0, void 0, function* () { | ||
export const pipeMiddleware = (req, res, middlewares) => __awaiter(void 0, void 0, void 0, function* () { | ||
var _a; | ||
@@ -22,11 +19,10 @@ if (middlewares.length === 0) { | ||
if ((_a = nextMiddlewareOption === null || nextMiddlewareOption === void 0 ? void 0 : nextMiddlewareOption.matcher) === null || _a === void 0 ? void 0 : _a.call(nextMiddlewareOption, req.nextUrl.pathname)) { | ||
return (0, exports.pipeMiddleware)(req, res, rest); | ||
return pipeMiddleware(req, res, rest); | ||
} | ||
const result = yield middleware(req, res); | ||
if ('_final' in result) { | ||
return result._final ? result.res : (0, exports.pipeMiddleware)(req, res, rest); | ||
return result._final ? result.res : pipeMiddleware(req, res, rest); | ||
} | ||
return (0, exports.pipeMiddleware)(req, result, rest); | ||
return pipeMiddleware(req, result, rest); | ||
}); | ||
exports.pipeMiddleware = pipeMiddleware; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "next-pipe-middleware", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
3523
37