docs: function(source) {
        var result = [];
  
        while(source.length > 0) {
          if(result.length > 0) {
            var nextTarget = source.pop();
  
            for(var i=0; i<result.length; i++) {
              var targetFile = result[i];
  
              var dependencies = dependenciesMap[targetFile].dependencies;
  
              var dependencyMatch = matchPatternFromArray(dependencies, dependenciesMap[nextTarget].dependencyPath.pattern);
  
              if(dependencyMatch) {
                break;
              }
            }
  
            // move dependent file to front
            result.splice(i, 0, nextTarget);
  
          } else {
            result.push(source.pop());
          }
        }
  
        return result;
      }