node-traceroute
node-traceroute copied to clipboard
Error on windows (variable scope)
I just tried to use your wrapper and got an error (solved it by myself, just for you to correct) See this code:
if (internals.isWin) {
for (let i = 0; i < lines.length; ++i) {
if (/^\s+1/.test(lines[i])) {
break;
}
}
lines.splice(0,i);
lines.pop();
lines.pop();
}
"let i" scope is only in the for loop and cant be accessed in lines.splice. Exchange let with var solves the problem Maybe lines.length instead of i would do it too i think