mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
12 lines
298 B
TypeScript
12 lines
298 B
TypeScript
import { RequestHandler } from 'express';
|
|
|
|
export const unless =
|
|
(path: string, middleware: RequestHandler): RequestHandler =>
|
|
(req, res, next) => {
|
|
if (path === req.path) {
|
|
return next();
|
|
} else {
|
|
return middleware(req, res, next);
|
|
}
|
|
};
|