docs: function(root, pathToDir, recursive, extension) {
      var pattern = new RegExp('^' + pathToDir.replace(/\*/, '.*'), 'g');
      var extPattern = new RegExp(extension + '$');
      var dirs = [];
      var matches = [];
      var self = this;
  
      fs.readdirSync(path.join(root, path.dirname(pathToDir))).forEach(function(match) {
        var fullPath = path.join(root, match),
          stat = fs.lstatSync(fullPath);
  
        if (match.match(pattern) && match.match(extPattern) && !stat.isDirectory())
          matches.push(fullPath);
        if (stat.isDirectory())
          dirs.push(fullPath);
      });
  
      if (this.sortingFix)
        matches = matches.sort();
  
      if (recursive) {
        dirs.forEach(function(dir) {
          self._scanDir(dir, '*', true, extension).forEach(function(match) {
            matches.push(match);
          });
        });
      }
  
      return matches;
    }