Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = result.filter((element: LSIF.Element) => {
/* ToDo@jumattos The element is a vertex here as well. Uncomment the if and test are failing*/
if (element.type !== ElementTypes.edge) {
return false;
}
let edge: Edge = element as Edge;
if (Edge.is11(edge)) {
return includes(inV, edge.inV);
} else {
console.log(JSON.stringify(edge, undefined, 0));
for (let item of edge.inVs) {
if (includes(inV, item)) {
return true;
}
}
return false;
}
});
result = result.filter((element: LSIF.Element) => {
case 'reference':
label = `${element.tag.text} [ref]`;
break;
}
}
break;
default:
label = element.label;
}
let node: VisNode = {
id: element.id as number,
label: label
}
data.nodes.push(node);
} else if (element.type === 'edge') {
if (Edge.is11(element)) {
data.edges.push({
from: element.outV as number,
to: element.inV as number,
label: element.label
});
} else {
for (let inV of element.inVs) {
data.edges.push({
from: element.outV as number,
to: inV as number,
label: element.label
});
}
}
}
},
private insertEdge(edge: Edge): void {
let label = this.shortForm(edge);
if (Edge.is11(edge)) {
this.edgeInserter.do(edge.id, label, edge.outV, edge.inV);
} else if (Edge.is1N(edge)) {
for (let inV of edge.inVs) {
this.edgeInserter.do(edge.id, label, edge.outV, inV);
}
}
}