@@ -44,8 +44,8 @@ export class OrderByPipe implements PipeTransform {
4444 ! Array . isArray ( config ) ||
4545 ( Array . isArray ( config ) && config . length == 1 )
4646 ) {
47- let propertyToCheck : string = ! Array . isArray ( config ) ? config : config [ 0 ] ;
48- let desc = propertyToCheck . substr ( 0 , 1 ) == '-' ;
47+ const propertyToCheck : string = ! Array . isArray ( config ) ? config : config [ 0 ] ;
48+ const desc = propertyToCheck . substr ( 0 , 1 ) == '-' ;
4949
5050 // Basic array
5151 if (
@@ -55,7 +55,7 @@ export class OrderByPipe implements PipeTransform {
5555 ) {
5656 return ! desc ? input . sort ( ) : input . sort ( ) . reverse ( ) ;
5757 } else {
58- let property : string =
58+ const property : string =
5959 propertyToCheck . substr ( 0 , 1 ) == '+' ||
6060 propertyToCheck . substr ( 0 , 1 ) == '-'
6161 ? propertyToCheck . substr ( 1 )
@@ -71,13 +71,13 @@ export class OrderByPipe implements PipeTransform {
7171 // Loop over property of the array in order and sort
7272 return input . sort ( ( a , b ) => {
7373 for ( let i = 0 ; i < config . length ; i ++ ) {
74- let desc = config [ i ] . substr ( 0 , 1 ) == '-' ;
75- let property =
74+ const desc = config [ i ] . substr ( 0 , 1 ) == '-' ;
75+ const property =
7676 config [ i ] . substr ( 0 , 1 ) == '+' || config [ i ] . substr ( 0 , 1 ) == '-'
7777 ? config [ i ] . substr ( 1 )
7878 : config [ i ] ;
7979
80- let comparison = ! desc
80+ const comparison = ! desc
8181 ? OrderByPipe . _orderByComparator ( a [ property ] , b [ property ] )
8282 : - OrderByPipe . _orderByComparator ( a [ property ] , b [ property ] ) ;
8383
0 commit comments