Skip to content

Commit 5dc3017

Browse files
committed
fix(config): make it simpler
1 parent 58d1bf2 commit 5dc3017

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/utils/configReader.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var path = require('path');
22

33
var extend = require('lodash/object/extend');
4+
var defaults = require('lodash/object/defaults');
45

56
var collectorConfig = require('../config');
67

@@ -32,10 +33,7 @@ function getConfig() {
3233
config.reporter = require('../reporters')[reporterType].create(reporterConfig);
3334
}
3435

35-
config.appName = collectorConfig.appName || config.appName;
36-
37-
config.collectInterval = collectorConfig.collectInterval;
38-
config.sampleSize = collectorConfig.sampleSize;
36+
config = defaults({}, collectorConfig, config);
3937

4038
//check if everything is ok with config
4139
if (!config.appName) {

0 commit comments

Comments
 (0)