Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
fix: make sure controller class name does not start with a number
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrantsberg committed Mar 3, 2020
1 parent af7f9a4 commit 8248a7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/loopback-proxy-app/legacy-loader.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit 8248a7c

Please sign in to comment.