1 exports.ddoc = function(ddoc) {
2 // only return the parts of the app that we use
3 var i, j, path, key, obj, ref, out = {},
4 resources = ddoc.couchapp && ddoc.couchapp.load && ddoc.couchapp.load.app || [];
5 for (i=0; i < resources.length; i++) {
6 path = resources[i].split('/');
9 for (j=0; j < path.length; j++) {
11 ref[key] = ref[key] || {};
12 if (j < path.length - 1) {