'use strict';

/* global -Promise */
var Promise = require('bluebird');
var _ = require('underscore');
var glob = require('glob');

var getFileList = function getFileList (files) {
  var fileList = [];

  return new Promise(function (resolve, reject) {
    if (_.isString(files)) {
      glob(files, function (err, files) {
        if (err) {
          reject(err);
        }
        fileList = files;
        resolve(fileList);
      });
    } else if (_.isArray(files)) {
      // TODO
    } else {
      throw new Error('You can only provide a String or an Array of filenames');
    }
  });
};

var getSupportedBrowserList = function getUnsupportedBrowserList (browsers) {
  return {
    ie: ['6']
  };
};

module.exports = {
  getFileList: getFileList,
  getSupportedBrowserList: getSupportedBrowserList
};

@@ -61,24 +61,25 @@
 bluebird');%0A
+%0A
 var _ = requ
@@ -108,24 +108,42 @@
  glob = 
+Promise.promisify(
 require(
 'glob');
@@ -138,15 +138,17 @@
 ire(
-'
+%22
 glob
-')
+%22));
 ;%0A%0Av
@@ -201,81 +201,65 @@
 %7B%0A  
-var fileList = %5B%5D;%0A%0A  return new Promise(function (resolve, reject) %7B%0A   
+if (_.isString(files)) %7B%0A    return glob(files);%0A  %7D else
  if 
@@ -255,38 +255,37 @@
  %7D else if (_.is
-String
+Array
 (files)) %7B%0A     
@@ -287,61 +287,61 @@
     
-  glob(files, function (err, files) %7B%0A        if (err
+var fileSubLists = _.map(files, function (fileSubList
 ) %7B%0A
@@ -350,164 +350,169 @@
     
-  
-  reject(err);%0A        %7D%0A        
+return glob(fileSubList);%0A    %7D);%0A%0A    return Promise.reduce(
 file
+Sub
 List
- = files;%0A        resolve(fileList);%0A      %7D);%0A    %7D else if (_.isArray(files)) %7B%0A      // TODO%0A    %7D else %7B%0A    
+s, function(fileList, subList) %7B%0A      return fileList.concat(subList);%0A    %7D, %5B%5D);%0A  %7D%0A%0A
   th
@@ -588,20 +588,8 @@
 ');%0A
-    %7D%0A  %7D);%0A
 %7D;%0A%0A

Use Promisify and add ability to get String/Array of globs in api