decord/beta/source/modules/connections/RoleConnectionRequirementUtils.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

59 lines
1.8 KiB
TypeScript

// Module ID: 18076
// Function ID: 18077
// Name: RoleConnectionRequirementUtils
// Dependencies: [5627, 2]
// Exports: displayedValueFor, minDisplayedValueFor, realizedOperatorFor, storedValueFor
// Module 18076 (RoleConnectionRequirementUtils)
import Constants from "Constants" /* 5627 */;
import size from "module_2" /* 2 */;
const OperatorTypes = Constants.OperatorTypes;
const result = size.fileFinishedImporting("modules/connections/RoleConnectionRequirementUtils.tsx");
export const realizedOperatorFor = function realizedOperatorFor(operator) {
let GREATER_THAN = operator;
if (operator == null) {
GREATER_THAN = OperatorTypes.GREATER_THAN;
}
return GREATER_THAN;
};
export const displayedValueFor = function displayedValueFor(value, realizedOperatorForResult) {
let num = value;
if (value == null) {
num = 0;
}
const rounded = Math.round(Number(num));
if (OperatorTypes.GREATER_THAN === realizedOperatorForResult) {
const _Math2 = Math;
return Math.max(1, rounded + 1);
} else if (tmp2.LESS_THAN === realizedOperatorForResult) {
const _Math = Math;
return Math.max(0, rounded - 1);
} else {
return rounded;
}
};
export const storedValueFor = function storedValueFor(TableSwitchRow, c7) {
let num = TableSwitchRow;
if (TableSwitchRow == null) {
num = 0;
}
const str = Math.round(Number(num));
if (OperatorTypes.GREATER_THAN === c7) {
const _Math2 = Math;
return Math.max(0, str - 1).toString();
} else if (tmp.LESS_THAN === c7) {
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;
} else if (tmp.LESS_THAN === arg0) {
return 0;
}
};