How to use the async-validator.default function in async-validator

To help you get started, we’ve selected a few async-validator 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 MiYogurt / egg-y-validator / app / extend / context.js View on Github external
return {
        validate: (fields, fn) => {
          try {
            fn(null, validator(fields));
          } catch (e) {
            fn(e);
          }
        },
      };
    }
    let open = this.app.config.validator.open;
    if (R.type(open) === 'Function' || R.type(open) === 'AsyncFunction') {
      open = await open(this);
    }
    const messages = this.app.config.validator.languages[open] || {};
    const validator = new Validate(config);
    validator.messages(messages);
    return validator;
  },
  async verify(path, type) {

async-validator

validate form asynchronous

MIT
Latest version published 2 years ago

Package Health Score

79 / 100
Full package analysis