compact body nodes in traversal

This commit is contained in:
Sebastian McKenzie
2015-01-02 01:59:49 +11:00
parent b1d1909c64
commit f1a178f8f9

View File

@@ -107,6 +107,11 @@ function traverse(parent, opts, scope) {
if (updated) {
parent[key] = _.flatten(parent[key]);
if (key === "body") {
// we can safely compact this
parent[key] = _.compact(parent[key]);
}
}
} else {
handle(parent, key);