From 818e43e54a7e7288d39a1d5811213054417ab926 Mon Sep 17 00:00:00 2001 From: anikethsaha Date: Tue, 28 May 2019 14:37:41 +0530 Subject: [PATCH] chore: loop change changed the loop --- packages/generators/utils/plugins.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/generators/utils/plugins.ts b/packages/generators/utils/plugins.ts index ab3d3698a45..560eaa35b50 100644 --- a/packages/generators/utils/plugins.ts +++ b/packages/generators/utils/plugins.ts @@ -43,11 +43,8 @@ export const replaceAt = (str: string, index: number, replace: string) : string export const generatePluginName = (rawPluginName: string): string => { let myPluginNameArray : string[]; myPluginNameArray = rawPluginName.split("-"); - if(myPluginNameArray.length <= 1){} - else{ - for (let i = 0; i < myPluginNameArray.length; i++) { - myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase()); - } + for (let i = 0; i < myPluginNameArray.length && myPluginNameArray.length > 1 ; i++) { + myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase()); } return myPluginNameArray.join("") }