UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

16 lines 763 B
import { ERROR_DICTIONARY, ERROR_LIST } from '../errors/dictionary'; import { getNumericValueFromArgument } from './getNumericValueFromArgument'; export function greaterThanOrEqualToReference(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: { greaterThanOrEqualTo: compareReference, } }); }; } //# sourceMappingURL=greaterThanOrEqualToReference.js.map