UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

38 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.compare = void 0; const like_1 = require("../text/like"); /** * Compares the two operands using the indicated operator * @param {any} left First operand * @param {string} op Operator * @param {any} right Second operand * @return true if the comparition succeds, false otherwise */ const compare = (left, op, right) => { switch (op) { case "<": return left < right; case "<=": return left <= right; case ">": return left > right; case ">=": return left >= right; case "=": return left === right; case "<>": return left !== right; case "like": if (typeof left === "string" && typeof right === "string") { return (0, like_1.like)(left, right); } else { return false; } default: return false; } }; exports.compare = compare; //# sourceMappingURL=compare.js.map