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