@qrvey/formula-lang
Version:
QFormula support for qrvey projects
16 lines • 590 B
JavaScript
import { ERROR_LIST, ERROR_DICTIONARY } from '../errors/dictionary';
import { AST_PRIMITIVES } from '../constants';
export function isNumberParam(param, dataType) {
const valid = typeof param === AST_PRIMITIVES.NUMBER ||
dataType === AST_PRIMITIVES.NUMBER;
const baseResponse = {
valid,
mismatchData: {
primitive: AST_PRIMITIVES.NUMBER,
},
};
if (!valid)
return Object.assign(Object.assign({}, baseResponse), ERROR_DICTIONARY[ERROR_LIST.missingNumber]);
return baseResponse;
}
//# sourceMappingURL=isNumberParam.js.map