gitlab-org--gitlab-foss/app/assets/javascripts/helpers/diffs_helper.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
454 B
JavaScript
Raw Normal View History

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;
}