UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

19 lines 934 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.greaterThanReference = void 0; const dictionary_1 = require("../errors/dictionary"); const getNumericValueFromArgument_1 = require("./getNumericValueFromArgument"); function greaterThanReference(compareReference) { return (param, _dataType, context) => { const arg = context.argument; const numericValue = (0, getNumericValueFromArgument_1.getNumericValueFromArgument)(param, arg); const valid = typeof numericValue !== 'number' || numericValue > compareReference; if (valid) return { valid }; return Object.assign(Object.assign({ valid }, dictionary_1.ERROR_DICTIONARY[dictionary_1.ERROR_LIST.matchRange]), { info: { greaterThan: compareReference, } }); }; } exports.greaterThanReference = greaterThanReference; //# sourceMappingURL=greaterThanReference.js.map