Welcome to mirror list, hosted at ThFree Co, Russian Federation.

diffs_helper.js « helpers « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9695d01ad3dbd958ec9f6508bfa72f2b495b0990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export function hasInlineLines(diffFile) {
  return diffFile?.highlighted_diff_lines?.length > 0; /* eslint-disable-line camelcase */
}

export function hasParallelLines(diffFile) {
  return diffFile?.parallel_diff_lines?.length > 0; /* eslint-disable-line camelcase */
}

export function isSingleViewStyle(diffFile) {
  return !hasParallelLines(diffFile) || !hasInlineLines(diffFile);
}

export function hasDiff(diffFile) {
  return (
    hasInlineLines(diffFile) ||
    hasParallelLines(diffFile) ||
    !diffFile?.blob?.readable_text /* eslint-disable-line camelcase */
  );
}