debian-mirror-gitlab/app/assets/javascripts/helpers/diffs_helper.js

16 lines
454 B
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
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;
}