Skip to content

Commit

Permalink
correctly sort undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev authored and anthony-redFox committed Dec 9, 2021
1 parent 66ae8ad commit 308f740
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sort.js
Expand Up @@ -110,6 +110,8 @@ function compareCommentsByField(field, a, b) {
if (akey && bkey) {
return akey.localeCompare(bkey, undefined, { caseFirst: 'upper' });
}
if (akey) return 1;
if (bkey) return -1;
return 0;
}

Expand Down

0 comments on commit 308f740

Please sign in to comment.