( docA: CategorizedPropertyMemberDoc, docB: CategorizedPropertyMemberDoc, )
| 28 | |
| 29 | /** Sorts property members by deprecated status, member decorator, and name. */ |
| 30 | export function sortCategorizedPropertyMembers( |
| 31 | docA: CategorizedPropertyMemberDoc, |
| 32 | docB: CategorizedPropertyMemberDoc, |
| 33 | ) { |
| 34 | // Sort deprecated docs to the end |
| 35 | if (!docA.isDeprecated && docB.isDeprecated) { |
| 36 | return -1; |
| 37 | } |
| 38 | |
| 39 | if (docA.isDeprecated && !docB.isDeprecated) { |
| 40 | return 1; |
| 41 | } |
| 42 | |
| 43 | // Sort in the order of: Inputs, Outputs, neither |
| 44 | if ((docA.isInput && !docB.isInput) || (docA.isOutput && !docB.isInput && !docB.isOutput)) { |
| 45 | return -1; |
| 46 | } |
| 47 | |
| 48 | if ((docB.isInput && !docA.isInput) || (docB.isOutput && !docA.isInput && !docA.isOutput)) { |
| 49 | return 1; |
| 50 | } |
| 51 | |
| 52 | // Break ties by sorting alphabetically on the name |
| 53 | if (docA.name < docB.name) { |
| 54 | return -1; |
| 55 | } |
| 56 | |
| 57 | if (docA.name > docB.name) { |
| 58 | return 1; |
| 59 | } |
| 60 | |
| 61 | return 0; |
| 62 | } |
nothing calls this directly
no outgoing calls
no test coverage detected