You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using switch(env) when env is an object and the cases are strings will always go to the default. It seems either the example is out of date or it should just be an if block.
module.exports = env => {
switch(env) {
case 'development':
return merge(commonConfig, developmentConfig);
case 'production':
return merge(commonConfig, productionConfig);
default:
throw new Error('No matching configuration was found!');
}
}
The text was updated successfully, but these errors were encountered:
On 19.03.2021, at 15:39, Cameron Avelis ***@***.***> wrote:
Using switch(env) when env is an object and the cases are strings will always go to the default. It seems either the example is out of date or it should just be an if block.
module.exports = env => {
switch(env) {
case 'development':
return merge(commonConfig, developmentConfig);
case 'production':
return merge(commonConfig, productionConfig);
default:
throw new Error('No matching configuration was found!');
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Using
switch(env)
when env is an object and the cases are strings will always go to thedefault
. It seems either the example is out of date or it should just be anif
block.The text was updated successfully, but these errors were encountered: