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:
Philip Molares 2022-09-24 19:05:34 +02:00 committed by David Mehren
parent 122de62b93
commit 1aa7dd618e

View file

@ -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);
};
}