4aab34dd by Gary Katsevman

switch to forEach to reduce for main return

1 parent 7865c573
/***** Start *****/
start
= tags:lines+ .* {
var obj = {},
choices = {
var choices = {
segments: 1,
comments: 1,
playlists: 1
};
tags.forEach(function(tag) {
return tags.reduce(function(obj, tag) {
for (var p in tag) {
if (p in choices) {
if (Object.prototype.toString.call(obj[p]) === '[object Array]') {
......@@ -18,10 +17,11 @@ start
} else {
obj[p] = tag[p];
}
}
});
return obj;
}
}, {});
}
lines
= comment:comment _ { var obj = {}; obj["comments"] = comment; return obj; }
......