f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/js/models/common/ComparisonResults.ts
-rw-r--r--
392
 1/**
 2 * Easier way to compare objects.
 3 */
 4export enum ComparisonResult {
 5  EQUAL = "EQUAL",
 6  LESS_THAN = "LESS_THAN",
 7  GREATER_THAN = "GREATER_THAN",
 8}
 9
10export function comparisonResultFromNumber(comparison: number) {
11  if (comparison < 0) {
12    return ComparisonResult.LESS_THAN;
13  }
14  if (comparison > 0) {
15    return ComparisonResult.GREATER_THAN;
16  }
17  return ComparisonResult.EQUAL;
18}