decord/source/modules/connections/RoleConnectionRequirementUtils.tsx

58 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 16794
// Function ID: 16795
2026-07-28 08:39:19 +00:00
// Name: realizedOperatorFor
2026-08-12 06:57:52 +00:00
// Dependencies: [5165, 2]
2026-07-28 08:39:19 +00:00
// Exports: displayedValueFor, minDisplayedValueFor, realizedOperatorFor, storedValueFor
2026-08-12 06:57:52 +00:00
// Module 16794 (realizedOperatorFor)
2026-07-28 08:39:19 +00:00
import { OperatorTypes } from "OperatorTypes";
const result = require("set").fileFinishedImporting("modules/connections/RoleConnectionRequirementUtils.tsx");
export const realizedOperatorFor = function realizedOperatorFor(operator) {
let GREATER_THAN = operator;
2026-07-29 08:29:29 +00:00
if (operator == null) {
2026-07-28 08:39:19 +00:00
GREATER_THAN = OperatorTypes.GREATER_THAN;
}
return GREATER_THAN;
};
export const displayedValueFor = function displayedValueFor(value, realizedOperatorForResult) {
2026-07-29 08:29:29 +00:00
let num = value;
if (value == null) {
num = 0;
2026-07-28 08:39:19 +00:00
}
const rounded = Math.round(Number(num));
if (OperatorTypes.GREATER_THAN === realizedOperatorForResult) {
const _Math2 = Math;
return Math.max(1, rounded + 1);
2026-07-29 08:29:29 +00:00
} else if (tmp2.LESS_THAN === realizedOperatorForResult) {
2026-07-28 08:39:19 +00:00
const _Math = Math;
return Math.max(0, rounded - 1);
} else {
return rounded;
}
};
2026-07-29 08:29:29 +00:00
export const storedValueFor = function storedValueFor(TableSwitchRow, c7) {
let num = TableSwitchRow;
if (TableSwitchRow == null) {
num = 0;
2026-07-28 08:39:19 +00:00
}
const str = Math.round(Number(num));
if (OperatorTypes.GREATER_THAN === c7) {
const _Math2 = Math;
return Math.max(0, str - 1).toString();
2026-07-29 08:29:29 +00:00
} else if (tmp.LESS_THAN === c7) {
2026-07-28 08:39:19 +00:00
const _Math = Math;
return Math.max(1, str + 1).toString();
} else {
return str.toString();
}
};
export const minDisplayedValueFor = function minDisplayedValueFor(arg0) {
if (OperatorTypes.GREATER_THAN === arg0) {
return 1;
2026-07-29 08:29:29 +00:00
} else if (tmp.LESS_THAN === arg0) {
2026-07-28 08:39:19 +00:00
return 0;
}
};