This repository was archived by the owner on Feb 2, 2021. It is now read-only.
File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ interface ISpawnFromEventOptions {
172
172
interface IProjectHelper {
173
173
projectDir : string ;
174
174
generateDefaultAppId ( appName : string , baseAppId : string ) : string ;
175
+ sanitizeName ( appName : string ) : string ;
175
176
}
176
177
177
178
interface IPropertiesParser {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export class ProjectHelper implements IProjectHelper {
39
39
}
40
40
41
41
public generateDefaultAppId ( appName : string , baseAppId : string ) : string {
42
- var sanitizedName = _ . filter ( appName . split ( "" ) , ( c ) => / [ a - z A - Z 0 - 9 ] / . test ( c ) ) . join ( "" ) ;
42
+ var sanitizedName = this . sanitizeName ( appName ) ;
43
43
if ( sanitizedName ) {
44
44
if ( / ^ \d + $ / . test ( sanitizedName ) ) {
45
45
sanitizedName = "the" + sanitizedName ;
@@ -50,5 +50,10 @@ export class ProjectHelper implements IProjectHelper {
50
50
51
51
return util . format ( "%s.%s" , baseAppId , sanitizedName ) ;
52
52
}
53
+
54
+ public sanitizeName ( appName : string ) : string {
55
+ var sanitizedName = _ . filter ( appName . split ( "" ) , ( c ) => / [ a - z A - Z 0 - 9 ] / . test ( c ) ) . join ( "" ) ;
56
+ return sanitizedName ;
57
+ }
53
58
}
54
59
$injector . register ( "projectHelper" , ProjectHelper ) ;
You can’t perform that action at this time.
0 commit comments