projects
/
arvados.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
22003: Workbench2 and keep-web: better interoperability with redirect
[arvados.git]
/
services
/
workbench2
/
src
/
common
/
array-utils.ts
1
// Copyright (C) The Arvados Authors. All rights reserved.
2
//
3
// SPDX-License-Identifier: AGPL-3.0
4
5
export const sortByProperty = (propName: string) => (obj1: any, obj2: any) => {
6
const prop1 = obj1[propName];
7
const prop2 = obj2[propName];
8
9
if (prop1 > prop2) {
10
return 1;
11
}
12
13
if (prop1 < prop2) {
14
return -1;
15
}
16
17
return 0;
18
};