Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
blocks.push(block);
}
lineCount += length;
return blocks;
}, []);
}
this.diffJson[0].isTrimmed = true;
this.loadMoreCount(Math.min(loadLimit, Math.max(0, lineCount - this.loadCount)));
let html;
if (this.textDiffType.value() === 'sidebysidediff') {
html = diff2html.getPrettySideBySideHtmlFromJson(this.diffJson);
} else {
html = diff2html.getPrettyHtmlFromJson(this.diffJson);
}
this.numberOfSelectedPatchLines = 0;
let index = 0;
// ko's binding resolution is not recursive, which means below ko.bind refresh method doesn't work for
// data bind at getPatchCheckBox that is rendered with "html" binding.
// which is reason why manually updating the html content and refreshing kobinding to have it render...
if (this.patchLineList) {
html = html.replace(/<span class="d2h-code-line-[a-z]+">(\+|\-)/g, (match, capture) => {
if (this.patchLineList()[index] === undefined) {
this.patchLineList()[index] = true;
}
return this.getPatchCheckBox(capture, index, this.patchLineList()[index++]);
});</span>
renderDiff(): string {
if(this.fileToRender) {
return Diff2Html.getPrettyHtmlFromJson(
this.sharedDiff.diff.filter(
fileContent => printerUtils.getHtmlId(fileContent) == this.fileToRender));
}
return Diff2Html.getPrettyHtmlFromJson(
[this.sharedDiff.diff[0]]);
}
renderDiff(): string {
if(this.fileToRender) {
return Diff2Html.getPrettyHtmlFromJson(
this.sharedDiff.diff.filter(
fileContent => printerUtils.getHtmlId(fileContent) == this.fileToRender));
}
return Diff2Html.getPrettyHtmlFromJson(
[this.sharedDiff.diff[0]]);
}