@qrvey/formula-lang
Version:
QFormula support for qrvey projects
15 lines • 723 B
JavaScript
import { ERROR_DICTIONARY, ERROR_LIST } from '../errors/dictionary';
import { getNumericValueFromArgument } from './getNumericValueFromArgument';
export function greaterThanReference(compareReference) {
return (param, _dataType, context) => {
const arg = context.argument;
const numericValue = getNumericValueFromArgument(param, arg);
const valid = typeof numericValue !== 'number' || numericValue > compareReference;
if (valid)
return { valid };
return Object.assign(Object.assign({ valid }, ERROR_DICTIONARY[ERROR_LIST.matchRange]), { info: {
greaterThan: compareReference,
} });
};
}
//# sourceMappingURL=greaterThanReference.js.map