validate(obj, options = {}) {
    // For Meteor apps, `check` option can be passed to silence audit-argument-checks
    const check = options.check || this._constructorOptions.check;
    if (typeof check === 'function') {
      // Call check but ignore the error
      try { check(obj); } catch (e) { /* ignore error */ }
    }

    // obj can be an array, in which case we validate each object in it and
    // throw as soon as one has an error
    const objects = Array.isArray(obj) ? obj : [obj];
    objects.forEach((oneObj) => {
      const validationContext = this.newContext();
      const isValid = validationContext.validate(oneObj, options);

      if (isValid) return;

      const errors = validationContext.validationErrors();

      // In order for the message at the top of the stack trace to be useful,
      // we set it to the first validation error message.
      const message = this.messageForError(errors[0]);

      const error = new Error(message);

      error.errorType = 'ClientError';
      error.name = 'ClientError';
      error.error = 'validation-error';

      // Add meaningful error messages for each validation error.
      // Useful for display messages when using 'mdg:validated-method'.
      error.details = errors.map((errorDetail) => ({ ...errorDetail, message: this.messageForError(errorDetail) }));

      // The primary use for the validationErrorTransform is to convert the
      // vanilla Error into a Meteor.Error until DDP is able to pass
      // vanilla errors back to the client.
      if (typeof SimpleSchema.validationErrorTransform === 'function') {
        throw SimpleSchema.validationErrorTransform(error);
      } else {
        throw error;
      }
    });
  }
@param obj {Object|Object[]} Object or array of objects to validate.
@param [options] {Object} Same options object that ValidationContext#validate takes

Throws an Error with name `ClientError` and `details` property containing the errors.