Skip to content

Commit 818e43e

Browse files
committedMay 28, 2019
chore: loop change
changed the loop
1 parent e583aab commit 818e43e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎packages/generators/utils/plugins.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ export const replaceAt = (str: string, index: number, replace: string) : string
4343
export const generatePluginName = (rawPluginName: string): string => {
4444
let myPluginNameArray : string[];
4545
myPluginNameArray = rawPluginName.split("-");
46-
if(myPluginNameArray.length <= 1){}
47-
else{
48-
for (let i = 0; i < myPluginNameArray.length; i++) {
49-
myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase());
50-
}
46+
for (let i = 0; i < myPluginNameArray.length && myPluginNameArray.length > 1 ; i++) {
47+
myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase());
5148
}
5249
return myPluginNameArray.join("")
5350
}

0 commit comments

Comments
 (0)
Please sign in to comment.