initial commit

This commit is contained in:
maxogden
2011-03-08 19:48:57 -08:00
commit 5e2a36bda5
16 changed files with 818 additions and 0 deletions

22
views/headers/reduce.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Reduces the passed in view headers to a list of unique object key attributes
*
* @author Max Ogden
*/
function(keys, values, rereduce) {
function include(arr, obj) {
return (arr.indexOf(obj) != -1);
}
var headers = [];
for (var doc in values) {
for (var header in values[doc]) {
if(!include(headers, values[doc][header])) {
headers.push(values[doc][header]);
}
}
}
return headers;
}