batch/reactor.cleanup/reactor.cleanup.batch.js
function getCleanupData(options) {
        var sourceResource = options.source;
        var targetResource = options.target === 'all' ? null : options.target;
        var targetReactor = options.reactor;
        var targetField = options.field;
        var cleanupData = [];

        // if source resource an option, we only use that, else we look at all resources
        var srcs = sourceResource === 'all' ? resources : [resources[sourceResource]];

        // loop through all resources
        _.each(srcs, function (resource) {

            // loop through all reactors in each resource
            _.each(resource.reactors, function (reactData) {

                // apply the options filters to determine if we are adding this resource and reactData
                if ((!targetReactor || reactData.type === targetReactor) &&
                    (!targetResource || reactData.target === targetResource ||
                        reactData.parent === targetResource || reactData.child === targetResource) &&
                    (!targetField || reactData.targetField === targetField)) {

                    cleanupData.push({ resource: resource, reactData: reactData });
                }
            });
        });

        return cleanupData;
    }
function getCleanupData(options) {
        var sourceResource = options.source;
        var targetResource = options.target === 'all' ? null : options.target;
        var targetReactor = options.reactor;
        var targetField = options.field;
        var cleanupData = [];

        // if source resource an option, we only use that, else we look at all resources
        var srcs = sourceResource === 'all' ? resources : [resources[sourceResource]];

        // loop through all resources
        _.each(srcs, function (resource) {

            // loop through all reactors in each resource
            _.each(resource.reactors, function (reactData) {

                // apply the options filters to determine if we are adding this resource and reactData
                if ((!targetReactor || reactData.type === targetReactor) &&
                    (!targetResource || reactData.target === targetResource ||
                        reactData.parent === targetResource || reactData.child === targetResource) &&
                    (!targetField || reactData.targetField === targetField)) {

                    cleanupData.push({ resource: resource, reactData: reactData });
                }
            });
        });

        return cleanupData;
    }
function getCleanupData ( options ) { var sourceResource = options . source ; var targetResource = options . target === 'all' ? null : options . target ; var targetReactor = options . reactor ; var targetField = options . field ; var cleanupData = [ ] ; // if source resource an option, we only use that, else we look at all resources var srcs = sourceResource === 'all' ? resources : [ resources [ sourceResource ] ] ; // loop through all resources _ . each ( srcs , function ( resource ) { // loop through all reactors in each resource _ . each ( resource . reactors , function ( reactData ) { // apply the options filters to determine if we are adding this resource and reactData if ( ( ! targetReactor || reactData . type === targetReactor ) && ( ! targetResource || reactData . target === targetResource || reactData . parent === targetResource || reactData . child === targetResource ) && ( ! targetField || reactData . targetField === targetField ) ) { cleanupData . push ( { resource : resource , reactData : reactData } ) ; } } ) ; } ) ; return cleanupData ; }
Get the cleanup data based on the batch options
@param options
Get the cleanup data based on the batch options