How to use the @ncform/ncform-common.ncformUtils.getValType function in @ncform/ncform-common

To help you get started, we’ve selected a few @ncform/ncform-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ncform / ncform / packages / ncform / src / regular-validation.js View on Github external
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,