debian-mirror-gitlab/app/assets/javascripts/helpers/diffs_helper.js
2020-03-09 13:42:32 +05:30

15 lines
454 B
JavaScript

export function hasInlineLines(diffFile) {
return diffFile?.highlighted_diff_lines?.length > 0;
}
export function hasParallelLines(diffFile) {
return diffFile?.parallel_diff_lines?.length > 0;
}
export function isSingleViewStyle(diffFile) {
return !hasParallelLines(diffFile) || !hasInlineLines(diffFile);
}
export function hasDiff(diffFile) {
return hasInlineLines(diffFile) || hasParallelLines(diffFile) || !diffFile?.blob?.readable_text;
}