keycloak-scim/src/util.ts
Donald Labaj adbb2c3d3f
Added github actions to automate build, test, and linting (#41)
Fixes issue #15.  Builds, test, lints, and checks format when a PR is created using github actions.
2020-09-01 10:51:59 -04:00

22 lines
414 B
TypeScript

import { ProviderRepresentation } from "./model/server-info";
export const sortProvider = (
a: [string, ProviderRepresentation],
b: [string, ProviderRepresentation]
) => {
let s1, s2;
if (a[1].order != b[1].order) {
s1 = b[1].order;
s2 = a[1].order;
} else {
s1 = a[0];
s2 = b[0];
}
if (s1 < s2) {
return -1;
} else if (s1 > s2) {
return 1;
} else {
return 0;
}
};