code: function matchesValidator(match) {
      return function matchValue(value) {
          var result;
  
          if (typeof match.test === "function") {
              match.lastIndex = 0; // reset the lastIndex just in case the regexp is accidentally global
              result = match.test(value);
          } else {
              result = match === value;
          }
  
          return result || "matches";
      };
  }
docs: Returns true if the given value matches the pattern. The pattern
  may be a value or a regular expression. If it's a value, a strict comparison
  will be performed. In case it's a regex, the test method will be invoked.
  
  @param {*|RegExp} match
  @returns {Function}