summaryrefslogtreecommitdiffstats
path: root/lib/config/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/config/index.js')
-rw-r--r--lib/config/index.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index 8bb93ad..272e92a 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -3,7 +3,7 @@ var semver = require('semver');
var gitbook = require('../gitbook');
var Promise = require('../utils/promise');
-var configDefault = require('./default');
+var validator = require('./validator');
var plugins = require('./plugins');
// Config files to tested (sorted)
@@ -69,8 +69,7 @@ Config.prototype.load = function() {
Config.prototype.replace = function(options) {
var that = this;
- this.options = _.cloneDeep(configDefault);
- this.options = _.merge(this.options, options || {});
+ this.options = validator.validate(options);
// options.input == book.root
Object.defineProperty(this.options, 'input', {
@@ -85,13 +84,6 @@ Config.prototype.replace = function(options) {
return that.book.parent? that.book.parent.root : undefined;
}
});
-
- // options.originalOutput == book.parent.options.output
- Object.defineProperty(this.options, 'originalOutput', {
- get: function () {
- return that.book.parent? that.book.parent.options.output : undefined;
- }
- });
};
// Return true if book has a configuration file