interlanguage-checker/src/main/js/Shared.ts

19 lines
756 B
TypeScript

/**
* The message that is displayed when the application fails to connect to the API.
*/
export const couldNotConnectMessage: string =
"Could not to connect to API. Is the URL correct? Are you using a script blocker? " +
"See the <b>About</b> section for more information.";
/**
* Returns the status that has the lowest index in the given list of statuses.
*
* @param statuses the statuses to look the given statuses up in
* @param status1 the first status
* @param status2 the second status
* @return the status that has the lowest index in the given list of statuses
*/
export const mergeStates = <T>(statuses: T[], status1: T, status2: T): T => {
return statuses[Math.min(statuses.indexOf(status1), statuses.indexOf(status2))];
};