MCPcopy Create free account
hub / github.com/angular/dev-infra / _categorizeCommits

Method _categorizeCommits

ng-dev/release/notes/context.ts:68–88  ·  view source on GitHub ↗

Gets a list of categorized commits from all commits in the release period.

(commits: CommitFromGitLog[])

Source from the content-addressed store, hash-verified

66
67 /** Gets a list of categorized commits from all commits in the release period. */
68 _categorizeCommits(commits: CommitFromGitLog[]): CategorizedCommit[] {
69 return commits.map((commit) => {
70 const {description, groupName} = this.data.categorizeCommit?.(commit) ?? {};
71 const escapedBreakingChanges = commit.breakingChanges.map((bc) => ({
72 ...bc,
73 text: escapeHtml(bc.text),
74 }));
75 const escapedDeprecations = commit.deprecations.map((dep) => ({
76 ...dep,
77 text: escapeHtml(dep.text),
78 }));
79 return {
80 ...commit,
81 type: escapeHtml(commit.type),
82 groupName: escapeHtml(groupName ?? commit.scope),
83 description: escapeHtml(description ?? commit.subject),
84 breakingChanges: escapedBreakingChanges,
85 deprecations: escapedDeprecations,
86 };
87 });
88 }
89
90 /**
91 * Comparator used for sorting commits within a release notes group. Commits

Callers 3

RenderContextClass · 0.95
context.spec.tsFile · 0.80

Calls 1

escapeHtmlFunction · 0.70

Tested by 1