lib/inline_config.js
function applyConfig(config) {
    var previous = {};

    config.rules.forEach(function (rule) {
        var isprev = (rule.value === '$previous');
        var setOption = function (name, value) {
            previous[name] = this.current[name];
            this.current[name] = this.setOption(name, value, isprev);
        }.bind(this);
        if (rule.type === 'rule') {
            setOption(rule.name, isprev ? this.previous[rule.name]
                                        : rule.value);
        /* istanbul ignore else */
        } else if (rule.type === 'preset') {
            var preset = isprev ? this.previousPreset
                                : presets.presets[rule.value];
            Object.keys(preset).forEach(function (name) {
                setOption(name, preset[name]);
            });
        }
    }.bind(this));

    lodash.merge(this.previous, this.previousPreset = previous);
}
function applyConfig(config) {
    var previous = {};

    config.rules.forEach(function (rule) {
        var isprev = (rule.value === '$previous');
        var setOption = function (name, value) {
            previous[name] = this.current[name];
            this.current[name] = this.setOption(name, value, isprev);
        }.bind(this);
        if (rule.type === 'rule') {
            setOption(rule.name, isprev ? this.previous[rule.name]
                                        : rule.value);
        /* istanbul ignore else */
        } else if (rule.type === 'preset') {
            var preset = isprev ? this.previousPreset
                                : presets.presets[rule.value];
            Object.keys(preset).forEach(function (name) {
                setOption(name, preset[name]);
            });
        }
    }.bind(this));

    lodash.merge(this.previous, this.previousPreset = previous);
}
function applyConfig ( config ) { var previous = { } ; config . rules . forEach ( function ( rule ) { var isprev = ( rule . value === '$previous' ) ; var setOption = function ( name , value ) { previous [ name ] = this . current [ name ] ; this . current [ name ] = this . setOption ( name , value , isprev ) ; } . bind ( this ) ; if ( rule . type === 'rule' ) { setOption ( rule . name , isprev ? this . previous [ rule . name ] : rule . value ) ; /* istanbul ignore else */ } else if ( rule . type === 'preset' ) { var preset = isprev ? this . previousPreset : presets . presets [ rule . value ] ; Object . keys ( preset ) . forEach ( function ( name ) { setOption ( name , preset [ name ] ) ; } ) ; } } . bind ( this ) ) ; lodash . merge ( this . previous , this . previousPreset = previous ) ; }
Apply the given cofiguration to this.current. Returns true if the operation resulted in any changes, false otherwise.
@param {Object} config - the new config to write onto the current options.
Apply the given cofiguration to this . current . Returns true if the operation resulted in any changes false otherwise .