diff --git a/src/index.ts b/src/index.ts index 1f6ec16..212be4b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -139,13 +139,13 @@ export class DepGraph { delete this.nodes[name]; delete this.outgoingEdges[name]; delete this.incomingEdges[name]; - [this.incomingEdges, this.outgoingEdges].forEach(function (edgeList) { - Object.keys(edgeList).forEach(function (key) { + [this.incomingEdges, this.outgoingEdges].forEach((edgeList) => { + Object.keys(edgeList).forEach((key) => { const idx = edgeList[key].indexOf(name); if (idx >= 0) { edgeList[key].splice(idx, 1); } - }, this); + }); }); } }