Skip to content

Commit 308f740

Browse files
mmomtchevanthony-redFox
authored andcommitted
correctly sort undefined values
1 parent 66ae8ad commit 308f740

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sort.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ function compareCommentsByField(field, a, b) {
110110
if (akey && bkey) {
111111
return akey.localeCompare(bkey, undefined, { caseFirst: 'upper' });
112112
}
113+
if (akey) return 1;
114+
if (bkey) return -1;
113115
return 0;
114116
}
115117

0 commit comments

Comments
 (0)