bin/ws-bower.js
function collectDependencies(bowerJson, dependencies) {
    if (bowerJson != null && bowerJson != undefined) {
        if (bowerJson.hasOwnProperty("dependencies")) {
            var dependenciesJson = bowerJson.dependencies;
            var dependencisKeys = Object.keys(dependenciesJson);
            var key;
            for (key in dependencisKeys) {
                var dependecyJson = dependenciesJson[dependencisKeys[key]];
                var dependency = createDependency(dependecyJson);
                if (dependency != null) {
                    dependencies.push(dependency);
                    collectDependencies(dependecyJson, dependencies);
                }
            }
        }
    }
}
function collectDependencies(bowerJson, dependencies) {
    if (bowerJson != null && bowerJson != undefined) {
        if (bowerJson.hasOwnProperty("dependencies")) {
            var dependenciesJson = bowerJson.dependencies;
            var dependencisKeys = Object.keys(dependenciesJson);
            var key;
            for (key in dependencisKeys) {
                var dependecyJson = dependenciesJson[dependencisKeys[key]];
                var dependency = createDependency(dependecyJson);
                if (dependency != null) {
                    dependencies.push(dependency);
                    collectDependencies(dependecyJson, dependencies);
                }
            }
        }
    }
}
this is the function for full tree /*
function collectDependencies(bowerJson) {
var dependencies = [];
if (bowerJson != null && bowerJson != undefined) {
if (bowerJson.hasOwnProperty("dependencies")) {
var dependenciesJson = bowerJson.dependencies;
var dependencisKeys = Object.keys(dependenciesJson);
var key;
for (key in dependencisKeys) {
var dependecyJson = dependenciesJson[dependencisKeys[key]];
var dependency = createDependency(dependecyJson);
if (dependency != null) {
dependency.children = collectDependencies(dependecyJson);
dependencies.push(dependency);
}
}
}
}
return dependencies;
}