serverless/lib/classes/config.js
Austen 158f644cd0
feat: Refactor logging to reduce complexity (#12432)
* chore: Change logger

* chore: continue refactor

* chore: WIP

* chore: Sync
2024-04-17 13:26:31 -07:00

29 lines
555 B
JavaScript

import _ from 'lodash';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
class Config {
constructor(serverless, config) {
this.serverless = serverless;
this.serverlessPath = path.join(__dirname, '..');
if (config) this.update(config);
}
update(config) {
return _.merge(this, config);
}
get servicePath() {
return this.serverless.serviceDir;
}
set servicePath(value) {
this.serverless.serviceDir = value;
}
}
export default Config;