summaryrefslogtreecommitdiffstats
path: root/lib/api/decodeConfig.js
blob: 351ed0554ed8a81166fea87f71d1f79fd6d47f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var Config = require('../models/config');

/**
    Decode changes from a JS API to a config object

    @param {Config} config
    @param {Object} result: result from API
    @return {Config}
*/
function decodeGlobal(config, result) {
    var values = result.values;

    delete values.generator;
    delete values.output;

    return Config.updateValues(config, values);
}

module.exports = decodeGlobal;