mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-23 00:33:18 +01:00
12 lines
352 B
JavaScript
Vendored
12 lines
352 B
JavaScript
Vendored
export default function middlewarePipeline(context, middlewares, index) {
|
|
const nextMiddleware = middlewares[index];
|
|
if (!nextMiddleware) {
|
|
return context.next;
|
|
}
|
|
return () => {
|
|
nextMiddleware({
|
|
...context,
|
|
nextMiddleware: middlewarePipeline(context, middlewares, index + 1),
|
|
});
|
|
};
|
|
} |