linting fix

useEther_5013
aniket-engg 4 years ago committed by Aniket
parent 80ac4d0b4a
commit 74c31b4b6c
  1. 6
      libs/remix-astwalker/src/astWalker.ts

@ -64,15 +64,15 @@ export class AstWalker extends EventEmitter {
nodes = nodes.filter(e => e) nodes = nodes.filter(e => e)
// If any element in nodes is array, extract its members // If any element in nodes is array, extract its members
let objNodes = [] const objNodes = []
nodes.forEach(x => { nodes.forEach(x => {
if (Array.isArray(x)) objNodes.push(...x) if (Array.isArray(x)) objNodes.push(...x)
else objNodes.push(x) else objNodes.push(x)
}); });
// Filter duplicate nodes using id field // Filter duplicate nodes using id field
let normalizedNodes = [] const normalizedNodes = []
objNodes.forEach((element, index) => { objNodes.forEach((element) => {
const firstIndex = normalizedNodes.findIndex(e => e.id === element.id) const firstIndex = normalizedNodes.findIndex(e => e.id === element.id)
if(firstIndex == -1) normalizedNodes.push(element) if(firstIndex == -1) normalizedNodes.push(element)
}) })

Loading…
Cancel
Save