diff --git a/src/app/pipes/array/order-by.ts b/src/app/pipes/array/order-by.ts index e3358747..8c64f331 100644 --- a/src/app/pipes/array/order-by.ts +++ b/src/app/pipes/array/order-by.ts @@ -48,8 +48,8 @@ export class OrderByPipe implements PipeTransform { } static orderCompare(prop, asc, a, b) { - const first = GeneralHelper.extractDeepPropertyByMapKey(a, prop); - const second = GeneralHelper.extractDeepPropertyByMapKey(b, prop); + const first = GeneralHelper.extractDeepPropertyByMapKey(a, prop), + second = GeneralHelper.extractDeepPropertyByMapKey(b, prop); if (first === second) { return 0; @@ -60,8 +60,9 @@ export class OrderByPipe implements PipeTransform { return asc ? pos : -pos; } - const pos = first < second ? -1 : 1; - return asc ? pos : -pos; + return asc + ? first - second + : second - first; } static extractFromConfig(config) {