Use spread syntax (convert to es2015) (#6317)

This commit is contained in:
Shinigami authored and GitHub committed 2020-02-25 03:05:49 +02:00
1 parent 129fcb6005
commit 59e15ec744
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ function flattenDoc(doc) {
for (let i = 0; i < doc.parts.length; ++i) {
const doc2 = doc.parts[i];
if (typeof doc2 !== "string" && doc2.type === "concat") {
[].push.apply(res, flattenDoc(doc2).parts);
res.push(...flattenDoc(doc2).parts);
} else {
const flattened = flattenDoc(doc2);
if (flattened !== "") {