UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

21 lines 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.iif = void 0; /** * Assigns a value depending on the evaluation of an expression. IIf is an abbreviation for Immediate if. * @param {boolean} condition Condition to be evaluated * @param {any} valueIfTrue Return value if the condition evaluates to true * @param {any} valueIfFalse Return value if the condition evaluates to false * @return any Either valueIfTrue or valueIfFalse depending on the condition */ const iif = (condition, valueIfTrue, valueIfFalse) => { if (condition === 0) { condition = true; } else if (condition === 1 || condition === -1) { condition = false; } return condition ? valueIfTrue : valueIfFalse; }; exports.iif = iif; //# sourceMappingURL=iif.js.map