From 8248a7cb6839383b8c758f2345629a860828ba07 Mon Sep 17 00:00:00 2001 From: dkrantsberg Date: Tue, 3 Mar 2020 11:47:47 -0500 Subject: [PATCH] fix: make sure controller class name does not start with a number --- lib/loopback-proxy-app/legacy-loader.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/loopback-proxy-app/legacy-loader.component.ts b/lib/loopback-proxy-app/legacy-loader.component.ts index b91dc5f..93a2ab2 100644 --- a/lib/loopback-proxy-app/legacy-loader.component.ts +++ b/lib/loopback-proxy-app/legacy-loader.component.ts @@ -339,7 +339,10 @@ function getPackageDependencies(manifest: any) { * Example: for mountPoint = "/:facility/client" it returns "FacilityClient" */ function getControllerPrefix(mountPoint: string, packageName: string) { - return _.words(`${mountPoint}/${packageName}`).map(_.capitalize).join('') + return _.words(`${mountPoint}/${packageName}`) + .map(_.capitalize) + .join('') + .replace(/^[0-9]/, "X"); // make sure prefix does not start with a number } /**