mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
23 lines
406 B
JavaScript
23 lines
406 B
JavaScript
'use strict';
|
|
|
|
const env = process.env;
|
|
const up = (a) => a.toUpperCase();
|
|
|
|
module.exports = parse;
|
|
module.exports.bool = (name) => {
|
|
const value = parse(name);
|
|
|
|
if (value === 'true')
|
|
return true;
|
|
|
|
if (value === 'false')
|
|
return false;
|
|
};
|
|
|
|
function parse(name) {
|
|
const small = `cloudcmd_${name}`;
|
|
const big = up(small);
|
|
|
|
return env[small] || env[big];
|
|
}
|
|
|