File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -94,25 +94,21 @@ module.exports = function sortDocs(comments: Array<Comment>, options: Object) {
94
94
return fixed . concat ( unfixed ) ;
95
95
} ;
96
96
97
- function compare ( a : string , b : string ) {
98
- return a . localeCompare ( b , undefined , { caseFirst : 'upper' } ) ;
99
- }
100
-
101
- function compareCommentsByName ( a , b ) {
102
- var akey = a . name ;
103
- var bkey = b . name ;
97
+ function compareCommentsByName ( a : Comment , b : Comment ) : number {
98
+ const akey : ?string = a . name ;
99
+ const bkey : ?string = b . name ;
104
100
105
101
if ( akey && bkey ) {
106
- return compare ( akey , bkey ) ;
102
+ return akey . localeCompare ( bkey , undefined , { caseFirst : 'upper' } ) ;
107
103
}
108
104
return 0 ;
109
105
}
110
106
111
- function compareCommentsBySourceLocation ( a , b ) {
107
+ function compareCommentsBySourceLocation ( a : Comment , b : Comment ) : number {
112
108
return a . context . sortKey . localeCompare ( b . context . sortKey ) ;
113
109
}
114
110
115
- function sortComments ( comments , sortOrder ) {
111
+ function sortComments ( comments : Array < Comment > , sortOrder : string ) {
116
112
return comments . sort (
117
113
sortOrder === 'alpha'
118
114
? compareCommentsByName
You can’t perform that action at this time.
0 commit comments