require('object.assign').shim();
var isEmpty = require('lodash.isempty');
var flatten = require('lodash.flatten');
var ValidationStrategy = require('./JoiValidationStrategy');

var ValidationFactory = Object.assign({
  isValid: function(errors, key) {
    if (isEmpty(errors)) {
      return true;
    } else {
      return key ? isEmpty(errors[key]) : isEmpty(errors);
    }
  },

  getValidationMessages: function(errors, key) {
    if (isEmpty(errors)) {
      return [];
    } else {
      if (key) {
        return errors[key] || [];
      } else {
        return flatten(Object.keys(errors).map(function(key) { return errors[key] || []; }));
      }
    }
  }
}, ValidationStrategy);

module.exports = ValidationFactory;

@@ -216,15 +216,29 @@
 %7B%0A  
-is
+get
 Valid
+ationMessages
 : fu
@@ -267,182 +267,30 @@
     
-if (isEmpty(errors)) %7B%0A      return true;%0A    %7D else %7B%0A      return key ? isEmpty(errors%5Bkey%5D) : isEmpty(errors);%0A    %7D%0A  %7D,%0A%0A  getValidationMessages: function(errors, key) %7B
+errors = errors %7C%7C %7B%7D;
 %0A   
@@ -520,16 +520,119 @@
    %7D%0A  %7D
+,%0A%0A  isValid: function(errors, key) %7B%0A    return isEmpty(this.getValidationMessages(errors, key));%0A  %7D,
 %0A%7D, Vali

Simplify `ValidationFactory` even more