diff --git a/lib/plugins/config/config.js b/lib/plugins/config/config.js index baed17f92..79517841a 100644 --- a/lib/plugins/config/config.js +++ b/lib/plugins/config/config.js @@ -3,11 +3,11 @@ const userStats = require('../../utils/userStats'); // class wide constants -const validProviders = ['aws']; +const validProviders = new Set(['aws']); // TODO: update to look like the list in the "create" plugin // once more than one provider is supported -const humanReadableProvidersList = `"${validProviders}"`; +const humanReadableProvidersList = `"${Array.from(validProviders)}"`; class Config { constructor(serverless, options) { @@ -43,7 +43,7 @@ class Config { validate() { const provider = this.options.provider.toLowerCase(); - if (validProviders.indexOf(provider) === -1) { + if (!validProviders.has(provider)) { const errorMessage = [ `Provider "${provider}" is not supported.`, ` Supported providers are: ${humanReadableProvidersList}.`,