chore: trim slashes with lodash

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2023-01-12 13:38:00 +01:00
parent 8c19b84088
commit 69e1e5bb63
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -48,6 +48,7 @@
"express-promise-router": "^4.1.0",
"fs-extra": "10.1.0",
"helmet": "^6.0.0",
"lodash": "^4.17.21",
"minimatch": "^5.0.0",
"morgan": "^1.10.0",
"node-forge": "^1.3.1",
@@ -16,9 +16,10 @@
import { RootHttpRouterService } from '@backstage/backend-plugin-api';
import { Handler, Router } from 'express';
import trimEnd from 'lodash/trimEnd';
function normalizePath(path: string): string {
return path.replace(/\/*$/, '/');
return `${trimEnd(path, '/')}/`;
}
/**
+1
View File
@@ -3400,6 +3400,7 @@ __metadata:
fs-extra: 10.1.0
helmet: ^6.0.0
http-errors: ^2.0.0
lodash: ^4.17.21
minimatch: ^5.0.0
morgan: ^1.10.0
node-forge: ^1.3.1