Skip to content

Commit

Permalink
refactor: use Array.from instead of spread
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed Jul 16, 2019
1 parent c0bbcb6 commit 8dff5c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rules/export.js
Expand Up @@ -31,12 +31,12 @@ const tsTypePrefix = 'type:'
* export function foo(a: string);
* export function foo(a: number|string) { return a; }
* ```
* @param {Object[]} nodes
* @param {Set<Object>} nodes
* @returns {boolean}
*/
function isTypescriptFunctionOverloads(nodes) {
return nodes.some(node => node.parent.type === 'TSDeclareFunction') &&
nodes.every(node => (
return Array.from(nodes).some(node => node.parent.type === 'TSDeclareFunction') &&
Array.from(nodes).every(node => (
node.parent.type === 'TSDeclareFunction' ||
node.parent.type === 'FunctionDeclaration'
))
Expand Down Expand Up @@ -141,7 +141,7 @@ module.exports = {
for (let [name, nodes] of named) {
if (nodes.size <= 1) continue

if (isTypescriptFunctionOverloads([...nodes])) continue
if (isTypescriptFunctionOverloads(nodes)) continue

for (let node of nodes) {
if (name === 'default') {
Expand Down

0 comments on commit 8dff5c8

Please sign in to comment.