mya-cli
Version:
MYA - AI-Powered Stock & Options Analysis CLI Tool
55 lines • 1.42 kB
JavaScript
/**
* Worker environment variable provider implementation
*/
/**
* Worker-based environment variable provider
* Single responsibility: load and provide environment variables from Worker env
*/
export class WorkerEnvironmentProvider {
env = {};
/**
* Create a new environment provider
* @param workerEnv Worker environment object
*/
constructor(workerEnv) {
this.env = workerEnv;
}
/**
* Load environment variables (no-op for Worker env)
*/
loadEnvironment() {
// No-op: environment is already loaded from Worker env
}
/**
* Get environment variable value
* @param key Environment variable key
* @returns Environment variable value or undefined
*/
get(key) {
return this.env[key];
}
/**
* Set environment variable value
* @param key Environment variable key
* @param value Environment variable value
*/
set(key, value) {
this.env[key] = value;
}
/**
* Check if environment variable exists
* @param key Environment variable key
* @returns True if environment variable exists
*/
has(key) {
return key in this.env;
}
/**
* Get all environment variables
* @returns Object with all environment variables
*/
getAll() {
return { ...this.env };
}
}
//# sourceMappingURL=worker-env-provider.js.map