Fixed bug in array swapping function

ref #14
This commit is contained in:
Nicolai Ort 2021-02-12 17:06:20 +01:00
parent d38923c4ad
commit 9697d53a15
1 changed files with 5 additions and 1 deletions

View File

@ -246,6 +246,10 @@ export class PdfCreator {
return null;
}
return [array[1], array[0]].concat(this.swapArrayPairs(array.slice(2)));
const rest = this.swapArrayPairs(array.slice(2))
if (!rest) {
return [array[1], array[0]]
}
return [array[1], array[0]].concat(rest);
}
}