'use strict';

function NumberLookupService(options) {
  this.sources = options.sources.map(function (Constructor) {
    return new Constructor();
  });
}

NumberLookupService.prototype.lookup = function (number) {
  var self = this;

  return new Promise(function (resolve) {
    var promises = self.sources.map(function (source) {
      return source.lookup(number);
    });

    Promise.all(promises).then(function (results) {
      results = results.filter(function (result) { return !!result; });
      resolve(results);
    });
  });
};
@@ -473,16 +473,24 @@
 esult) %7B
+%0A       
  return 
@@ -501,14 +501,71 @@
 sult
-;
+ %7C%7C (Array.isArray(result) && result.length === 0);%0A     
  %7D);%0A
+%0A
     
@@ -600,8 +600,9 @@
   %7D);%0A%7D;
+%0A

Filter out results that are empty arrays