mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-02 21:26:42 +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),
|
|
});
|
|
};
|
|
} |