MCPcopy Create free account
hub / github.com/angular/components / sortCategorizedMethodMembers

Function sortCategorizedMethodMembers

tools/dgeni/common/sort-members.ts:4–27  ·  view source on GitHub ↗
(
  docA: CategorizedMethodMemberDoc,
  docB: CategorizedMethodMemberDoc,
)

Source from the content-addressed store, hash-verified

2
3/** Sorts method members by deprecated status, member decorator, and name. */
4export function sortCategorizedMethodMembers(
5 docA: CategorizedMethodMemberDoc,
6 docB: CategorizedMethodMemberDoc,
7) {
8 // Sort deprecated docs to the end
9 if (!docA.isDeprecated && docB.isDeprecated) {
10 return -1;
11 }
12
13 if (docA.isDeprecated && !docB.isDeprecated) {
14 return 1;
15 }
16
17 // Break ties by sorting alphabetically on the name
18 if (docA.name < docB.name) {
19 return -1;
20 }
21
22 if (docA.name > docB.name) {
23 return 1;
24 }
25
26 return 0;
27}
28
29/** Sorts property members by deprecated status, member decorator, and name. */
30export function sortCategorizedPropertyMembers(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected