Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new Promise(resolve => {
// 对自定义规则进行验证
if (keys[i] === "customRule") {
const { customRule } = rules;
if (ncformUtils.getValType(customRule) !== "array") {
resolve({
result: false,
errMsg:
"【Error】自定义验证规则应为对象数组,每项包含script,errMsg字段。"
});
}
customRule.forEach(item => {
if (
!ncformUtils.smartAnalyzeVal(item.script, {
idxChain,
data: { rootData: formData, constData: globalConfig.constants }
})
) {
resolve({
result: false,