index.js
function (file, enc, cb) {
        var yaml_files = options.src;

        if (typeof yaml_files === 'string') {
            yaml_files = [yaml_files];
        }

        var yaml_data = {};

        // Read all files in order, and override if later files contain same values.
        for (var i = 0; i < yaml_files.length; i++) {
            yaml_data = Object.assign(yaml_data, readYamlFile(yaml_files[i]));
        }

        var current_data = file[options.property];
        var new_data = null;

        // Merge with possible previous data.
        if (options.override) {
            new_data = Object.assign(current_data, yaml_data);
        } else {
            new_data = Object.assign(yaml_data, current_data);
        }

        file[options.property] = new_data;

        cb(null, file);
    }
function (file, enc, cb) {
        var yaml_files = options.src;

        if (typeof yaml_files === 'string') {
            yaml_files = [yaml_files];
        }

        var yaml_data = {};

        // Read all files in order, and override if later files contain same values.
        for (var i = 0; i < yaml_files.length; i++) {
            yaml_data = Object.assign(yaml_data, readYamlFile(yaml_files[i]));
        }

        var current_data = file[options.property];
        var new_data = null;

        // Merge with possible previous data.
        if (options.override) {
            new_data = Object.assign(current_data, yaml_data);
        } else {
            new_data = Object.assign(yaml_data, current_data);
        }

        file[options.property] = new_data;

        cb(null, file);
    }
function ( file , enc , cb ) { var yaml_files = options . src ; if ( typeof yaml_files === 'string' ) { yaml_files = [ yaml_files ] ; } var yaml_data = { } ; // Read all files in order, and override if later files contain same values. for ( var i = 0 ; i < yaml_files . length ; i ++ ) { yaml_data = Object . assign ( yaml_data , readYamlFile ( yaml_files [ i ] ) ) ; } var current_data = file [ options . property ] ; var new_data = null ; // Merge with possible previous data. if ( options . override ) { new_data = Object . assign ( current_data , yaml_data ) ; } else { new_data = Object . assign ( yaml_data , current_data ) ; } file [ options . property ] = new_data ; cb ( null , file ) ; }
Transform current stream to include a YAML data file.
Transform current stream to include a YAML data file .