diff --git a/.eslintrc b/.eslintrc index 5570f8073..662e91da3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -49,6 +49,8 @@ "unicorn/no-new-buffer": "error", "unicorn/no-instanceof-array": "error", "unicorn/no-useless-spread": "error", + "unicorn/prefer-array-flat": "error", + "unicorn/prefer-array-flat-map": "error", "unicorn/prefer-at": "error", "unicorn/prefer-date-now": "error", "unicorn/prefer-dom-node-append": "error", diff --git a/src/core/xfa/som.js b/src/core/xfa/som.js index 9015a81c4..02011b05a 100644 --- a/src/core/xfa/som.js +++ b/src/core/xfa/som.js @@ -254,7 +254,7 @@ function searchNode( if (isFinite(index)) { root = nodes.filter(node => index < node.length).map(node => node[index]); } else { - root = nodes.reduce((acc, node) => acc.concat(node), []); + root = nodes.flat(); } }