fix bug where no input leads to error in console
This commit is contained in:
parent
54e559c5a6
commit
6b75ba8903
@ -39,7 +39,7 @@ class AddLineNumbers extends Operation {
|
||||
run(input, args) {
|
||||
const lines = input.split("\n"),
|
||||
width = lines.length.toString().length;
|
||||
const offset = parseInt(args[0], 10);
|
||||
const offset = args[0] ? parseInt(args[0], 10) : 0;
|
||||
let output = "";
|
||||
|
||||
for (let n = 0; n < lines.length; n++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user