virtual-star/lib/env.js

17 lines
448 B
JavaScript
Raw Normal View History

2025-02-18 17:50:05 -05:00
export const ENV = {
getValue: function (key) {
return process.env[key];
},
getBoolean: function (key) {
return (this.getValue(key)?.toLowerCase?.() === 'true');
},
getNumber: function (key) {
return parseFloat(this.getValue(key));
},
getString: function (key) {
return this.getValue(key);
},
getIsSet: function (key) {
return (this.getValue(key) !== undefined);
},
};