nl_tokens: This function sorts an array by multiple fields .
pl_tokens: function multiFieldSort ( array , sortBy ) { array . sort ( ( a , b ) => { for ( let <mask> of sortBy ) { let reverse = field [ 0 ] === '-' ; if ( reverse ) { field = field . slice ( 1 ) ; } let valueA = getPath ( a , field ) ; let valueB = getPath ( b , field ) ; if ( reverse ) { if ( valueA > valueB ) return - 1 ; else if ( valueA < valueB ) return 1 ; } else { if ( valueA > valueB ) return 1 ; else if ( valueA < valueB ) return - 1 ; } } return 0 ; } ) ; return array ; }