lib/DefaultDataHandler.js
function init(app) {
    var keys = Object.keys(DependenciesMap);
    var allDeps = _.uniq(_.flatten(_.values(DependenciesMap)));

    allDeps.forEach(function (d) {
        if (!_.contains(keys, d)) {
            throw new Error("Unresolved dependency: " + d)
        }
    });


    keys.forEach(function (k) {
        var dep = DependenciesMap[k];
        if (_.contains(dep, k)) {
            throw new Error('Circular dependency: key: ' + k);
        }

        if (dep.length == 0) {
            HandlerArray.push(getHandler(app, k, PluginsData[k]));
        }
    });

    async.series(HandlerArray, function (err, end) {
        if (err)
            throw err;

        saveSchemas(app);
    });
}
function init(app) {
    var keys = Object.keys(DependenciesMap);
    var allDeps = _.uniq(_.flatten(_.values(DependenciesMap)));

    allDeps.forEach(function (d) {
        if (!_.contains(keys, d)) {
            throw new Error("Unresolved dependency: " + d)
        }
    });


    keys.forEach(function (k) {
        var dep = DependenciesMap[k];
        if (_.contains(dep, k)) {
            throw new Error('Circular dependency: key: ' + k);
        }

        if (dep.length == 0) {
            HandlerArray.push(getHandler(app, k, PluginsData[k]));
        }
    });

    async.series(HandlerArray, function (err, end) {
        if (err)
            throw err;

        saveSchemas(app);
    });
}
function init ( app ) { var keys = Object . keys ( DependenciesMap ) ; var allDeps = _ . uniq ( _ . flatten ( _ . values ( DependenciesMap ) ) ) ; allDeps . forEach ( function ( d ) { if ( ! _ . contains ( keys , d ) ) { throw new Error ( "Unresolved dependency: " + d ) } } ) ; keys . forEach ( function ( k ) { var dep = DependenciesMap [ k ] ; if ( _ . contains ( dep , k ) ) { throw new Error ( 'Circular dependency: key: ' + k ) ; } if ( dep . length == 0 ) { HandlerArray . push ( getHandler ( app , k , PluginsData [ k ] ) ) ; } } ) ; async . series ( HandlerArray , function ( err , end ) { if ( err ) throw err ; saveSchemas ( app ) ; } ) ; }
Start handling default data provided in plugins and save those collections which are not having dependencies.
@param app
Start handling default data provided in plugins and save those collections which are not having dependencies .