From 4872416a5b2859021a2d969db0685227f108e253 Mon Sep 17 00:00:00 2001 From: anikethsaha Date: Thu, 30 May 2019 11:34:56 +0530 Subject: [PATCH] chore: pluginarrlength for length of the plugin assigned length of the plugin to a constant --- packages/generators/utils/plugins.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/generators/utils/plugins.ts b/packages/generators/utils/plugins.ts index 560eaa35b50..4b60bd3f307 100644 --- a/packages/generators/utils/plugins.ts +++ b/packages/generators/utils/plugins.ts @@ -43,7 +43,8 @@ export const replaceAt = (str: string, index: number, replace: string) : string export const generatePluginName = (rawPluginName: string): string => { let myPluginNameArray : string[]; myPluginNameArray = rawPluginName.split("-"); - for (let i = 0; i < myPluginNameArray.length && myPluginNameArray.length > 1 ; i++) { + const pluginArrLength : number = myPluginNameArray.length; + for (let i = 0; i < pluginArrLength && pluginArrLength > 1 ; i++) { myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase()); } return myPluginNameArray.join("")