Use spread syntax (convert to es2015) (#6317)
This commit is contained in:
1 parent
129fcb6005
commit
59e15ec744
3 files changed
+3
-3
No files matched your search
@@ -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 !== "") {
|
||||
|
||||
Reference in new issue
Block a user