We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b3efb5f + fdea4a7 commit a70fd98Copy full SHA for a70fd98
src/amadeus/client/validator.js
@@ -80,12 +80,9 @@ class Validator {
80
}
81
82
initOptional(key, options, fallback = null) {
83
- let value = options[key];
84
//Env variables names expected to be in SNAKE_CASE and uppercase
85
let envKey = `AMADEUS_${key.replace(/[A-Z]/g, c => `_${c.toLowerCase()}`).toUpperCase()}`;
86
- if (value == undefined) { value = options[key]; }
87
- if (value == undefined) { value = process.env[envKey]; }
88
- if (value == undefined) { value = fallback; }
+ let value = options[key] || process.env[envKey] || fallback;
89
return value;
90
91
0 commit comments