mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
refactor: delete unused function useUnless
This function was introduced by 0da7d01dec
to proxy request to the frontend, but it's not used anymore and can therefore be removed.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
122de62b93
commit
1aa7dd618e
1 changed files with 0 additions and 18 deletions
|
@ -1,18 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
import { NextFunction, Request, Response } from 'express';
|
|
||||||
|
|
||||||
export function useUnless(
|
|
||||||
paths: string[],
|
|
||||||
middleware: (req: Request, res: Response, next: NextFunction) => unknown,
|
|
||||||
) {
|
|
||||||
return function (req: Request, res: Response, next: NextFunction): unknown {
|
|
||||||
if (paths.some((path) => req.path.startsWith(path))) {
|
|
||||||
return next();
|
|
||||||
}
|
|
||||||
return middleware(req, res, next);
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue