Address PR comments

Signed-off-by: Musaab Elfaqih <musaabe@spotify.com>
This commit is contained in:
Musaab Elfaqih
2025-01-17 17:33:47 +01:00
parent 029a1c4e16
commit d1eea59bd3
@@ -122,16 +122,16 @@ class AppTreeApiProxy implements AppTreeApi {
this.checkIfInitialized();
let path = sourcePath;
if (sourcePath.startsWith(this.appBasePath)) {
path = sourcePath.slice(this.appBasePath.length);
if (path.startsWith(this.appBasePath)) {
path = path.slice(this.appBasePath.length);
}
const matchedRoutes = matchRoutes(this.#routeInfo!.routeObjects, path);
const matchedAppNodes =
matchedRoutes
?.filter(routeObj => !!routeObj.route.appNode)
.map(routeObj => routeObj.route.appNode!) || [];
?.map(routeObj => routeObj.route.appNode)
.filter(appNode => !!appNode) || [];
return { nodes: matchedAppNodes };
}