Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (rightSideChars > 1) {
// larger on right side
errorLine = errorLine.substr(0, errorLine.length - 1);
rightSideChars--;
} else {
break;
}
}
const lineChars: string[] = [];
const lineLength = Math.max(errorLine.length, errorCharStart + errorLength);
for (var i = 0; i < lineLength; i++) {
var chr = errorLine.charAt(i);
if (i >= errorCharStart && i < errorCharStart + errorLength) {
chr = color.bgRed(chr === '' ? ' ' : chr);
}
lineChars.push(chr);
}
return lineChars.join('');
}