mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Improve internal representation of validProviders
This commit is contained in:
parent
aaf3e8b7ed
commit
a3422d3663
@ -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}.`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user