File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,30 +81,17 @@ class Stats {
8181 } ;
8282
8383 const sortByField = ( field ) => {
84- let callback ;
8584 if ( ! field ) {
86- callback = ( ) => 0 ;
87- return callback ;
85+ return ( ) => 0 ;
8886 }
8987
90- if ( field [ 0 ] === "!" ) {
91- field = field . substr ( 1 ) ;
92- callback = ( a , b ) => {
93- if ( a [ field ] === null && b [ field ] === null ) return 0 ;
94- if ( a [ field ] === null ) return 1 ;
95- if ( b [ field ] === null ) return - 1 ;
96- if ( a [ field ] === b [ field ] ) return 0 ;
97- return a [ field ] < b [ field ] ? 1 : - 1 ;
98- } ;
99- }
100- callback = ( a , b ) => {
88+ return ( a , b ) => {
10189 if ( a [ field ] === null && b [ field ] === null ) return 0 ;
10290 if ( a [ field ] === null ) return 1 ;
10391 if ( b [ field ] === null ) return - 1 ;
10492 if ( a [ field ] === b [ field ] ) return 0 ;
10593 return a [ field ] < b [ field ] ? - 1 : 1 ;
10694 } ;
107- return callback ;
10895 } ;
10996
11097 const formatError = ( e ) => {
You can’t perform that action at this time.
0 commit comments