# all files / lib/ filehound.js

98.26% Statements 169/172
70% Branches 42/60
100% Functions 59/59
100% Lines 144/144

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770

    1×

    30×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    1×

    4×

    63×

    63×

    1×

    1×
    200×

    1×
    267×

    1×
    134×

    1×
    8×
    28×

    1×
    8×
    3×

    5×

    1×
    1×

    1×
    63×

    63×

    63×
    63×
    63×
    63×
    63×
    63×
    63×
    63×

    1×

    3×
    15×
    15×

    3×

    3×
    15×
    15×

    3×

    3×
    15×
    15×

    3×

    44×
    44×

    63×
    63×

    6×

    6×

    6×
    6×
    8×

    6×

    6×

    6×
    20×

    6×

    10×
    37×
    37×

    10×

    1×
    1×

    1×

    7×
    64×

    7×

    4×
    4×

    2×
    9×

    2×

    2×
    2×

    4×
    4×

    1×
    1×

    1×

    4×
    4×

    57×

    57×

    57×
    57×

    57×
    3×
    1×

    57×

    3×

    3×

    3×

    139×
    136×

    139×

    60×
    60×
    4×

    56×

    60×

    3×
    3×
    3×
    3×
    3×

    60×

    60×
    60×
    60×

    57×
    57×

    54×
    116×

    54×

    101×

    101×

    91×
    91×
    262×
    38×

    38×

    224×

    64×

    64×

    63×

    1×
    1×

    1×

    1×'use strict';

    Object.defineProperty(exports, "__esModule", {
      value: true
    });

    var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; Eif ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (EprotoProps) defineProperties(Constructor.prototype, protoProps); Eif (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

    var _lodash = require('lodash');

    var _lodash2 = _interopRequireDefault(_lodash);

    var _bluebird = require('bluebird');

    var _bluebird2 = _interopRequireDefault(_bluebird);

    var _path = require('path');

    var _path2 = _interopRequireDefault(_path);

    var _fileJs = require('file-js');

    var _fileJs2 = _interopRequireDefault(_fileJs);

    var _functions = require('./functions');

    var _files = require('./files');

    var _arrays = require('./arrays');

    var _unitCompare = require('unit-compare');

    var _events = require('events');

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

    function _classCallCheck(instance, Constructor) { if (I!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

    function _possibleConstructorReturn(self, call) { if (I!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

    function _inherits(subClass, superClass) { if (Itypeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); Eif (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

    function isDefined(value) {
      return value !== undefined;
    }

    function flatten(a, b) {
      return a.concat(b);
    }

    function getFilename(file) {
      return file.getName();
    }

    function isRegExpMatch(pattern) {
      return function (file) {
        return new RegExp(pattern).test(file.getName());
      };
    }

    function cleanExtension(ext) {
      if (_lodash2.default.startsWith(ext, '.')) {
        return ext.slice(1);
      }
      return ext;
    }

    /** @class */

    var FileHound = function (_EventEmitter) {
      _inherits(FileHound, _EventEmitter);

      function FileHound() {
        _classCallCheck(this, FileHound);

        var _this = _possibleConstructorReturn(this, (FileHound.__proto__ || Object.getPrototypeOf(FileHound)).call(this));

        _this._filters = [];
        _this._searchPaths = [];
        _this._searchPaths.push(process.cwd());
        _this._ignoreHiddenDirectories = false;
        _this._isMatch = _lodash2.default.noop;
        _this._sync = false;
        _this._directoriesOnly = false;
        return _this;
      }

      /**
       * Static factory method to create an instance of FileHound
       *
       * @static
       * @memberOf FileHound
       * @method
       * create
       * @return FileHound instance
       * @example
       * import FileHound from 'filehound';
       *
       * const filehound = FileHound.create();
       */

      _createClass(FileHound, [{
        key: 'modified',

        /**
         * Filters by modifiction time
         *
         * @memberOf FileHound
         * @method
         * modified
         * @param {string} dateExpression - date expression
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .modified("< 2 days")
         *   .find()
         *   .each(console.log);
         */
        value: function modified(pattern) {
          this.addFilter(function (file) {
            var modified = file.lastModifiedSync();
            return (0, _unitCompare.isDate)(modified).assert(pattern);
          });
          return this;
        }

        /**
         * Filters by file access time
         *
         * @memberOf FileHound
         * @method
         * accessed
         * @param {string} dateExpression - date expression
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .accessed("< 10 minutes")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'accessed',
        value: function accessed(pattern) {
          this.addFilter(function (file) {
            var accessed = file.lastAccessedSync();
            return (0, _unitCompare.isDate)(accessed).assert(pattern);
          });
          return this;
        }

        /**
         * Filters change time
         *
         * @memberOf FileHound
         * @instance
         * @method
         * changed
         * @param {string} dateExpression - date expression
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .changed("< 10 minutes")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'changed',
        value: function changed(pattern) {
          this.addFilter(function (file) {
            var changed = file.lastChangedSync();
            return (0, _unitCompare.isDate)(changed).assert(pattern);
          });
          return this;
        }

        /**
         *
         * @memberOf FileHound
         * @instance
         * @method
         * addFilter
         * @param {function} function - custom filter function
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .addFilter(customFilter)
         *   .find()
         *   .each(consoe.log);
         */

      }, {
        key: 'addFilter',
        value: function addFilter(filter) {
          this._filters.push(filter);
          return this;
        }

        /**
         * Defines the search paths
         *
         * @memberOf FileHound
         * @instance
         * @method
         * paths
         * @param {array} path - array of paths
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .paths("/tmp", "/etc") // or ["/tmp", "/etc"]
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'paths',
        value: function paths() {
          this._searchPaths = _lodash2.default.uniq((0, _arrays.from)(arguments)).map(_path2.default.normalize);
          return this;
        }

        /**
         * Define the search path
         *
         * @memberOf FileHound
         * @instance
         * @method
         * path
         * @param {string} path - path
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .path("/tmp")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'path',
        value: function path() {
          return this.paths((0, _arrays.fromFirst)(arguments));
        }

        /**
         * Ignores files or sub-directories matching pattern
         *
         * @memberOf FileHound
         * @instance
         * @method
         * discard
         * @param {string|array} regex - regex or array of regex
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .discard("*.tmp*")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'discard',
        value: function discard() {
          var _this2 = this;

          var patterns = (0, _arrays.from)(arguments);
          patterns.forEach(function (pattern) {
            _this2.addFilter((0, _functions.negate)(isRegExpMatch(pattern)));
          });
          return this;
        }

        /**
         * Filter on file extension
         *
         * @memberOf FileHound
         * @instance
         * @method
         * ext
         * @param {string|array} extensions - extension or an array of extensions
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * let filehound = FileHound.create();
         * filehound
         *   .ext(".json")
         *   .find()
         *   .each(console.log);
         *
         * // array of extensions to filter by
         * filehound = FileHound.create();
         * filehound
         *   .ext([".json", ".txt"])
         *   .find()
         *   .each(console.log);
         *
         * // supports var args
         * filehound = FileHound.create();
         * filehound
         *   .ext(".json", ".txt")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'ext',
        value: function ext() {
          var extensions = (0, _arrays.from)(arguments).map(cleanExtension);

          this.addFilter(function (file) {
            return _lodash2.default.includes(extensions, file.getPathExtension());
          });
          return this;
        }

        /**
         * Filter by file size
         *
         * @memberOf FileHound
         * @instance
         * @method
         * size
         * @param {string} sizeExpression - a size expression
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .size("<10kb")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'size',
        value: function size(sizeExpression) {
          this.addFilter(function (file) {
            var size = file.sizeSync();
            return (0, _unitCompare.isNumber)(size).assert(sizeExpression);
          });
          return this;
        }

        /**
         * Filter by zero length files
         *
         * @memberOf FileHound
         * @instance
         * @method
         * isEmpty
         * @param {string} path - path
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .size("<10kb")
         *   .find()
         *   .each(console.log);
         */

      }, {
        key: 'isEmpty',
        value: function isEmpty() {
          this.size(0);
          return this;
        }

        /**
         * Filter by a file glob
         *
         * @memberOf FileHound
         * @instance
         * @method
         * glob
         * @param {string} glob - file glob
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .glob("*tmp*")
         *   .find()
         *   .each(console.log); // array of files names all containing 'tmp'
         */

      }, {
        key: 'glob',
        value: function glob(globPattern) {
          return this.match(globPattern);
        }

        /**
         * Same as glob
         * @see glob
         */

      }, {
        key: 'match',
        value: function match(globPattern) {
          this.addFilter(function (file) {
            return file.isMatch(globPattern);
          });
          return this;
        }

        /**
         * Negates filters
         *
         * @memberOf FileHound
         * @instance
         * @method
         * not
         * @param {string} glob - file glob
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .not()
         *   .glob("*tmp*")
         *   .find()
         *   .each(console.log); // array of files names NOT containing 'tmp'
         */

      }, {
        key: 'not',
        value: function not() {
          this.negateFilters = true;
          return this;
        }

        /**
         * Filter to ignore hidden files
         *
         * @memberOf FileHound
         * @instance
         * @method
         * ignoreHiddenFiles
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .ignoreHiddenFiles()
         *   .find()
         *   .each(console.log); // array of files names that are not hidden files
         */

      }, {
        key: 'ignoreHiddenFiles',
        value: function ignoreHiddenFiles() {
          this.addFilter(function (file) {
            return !file.isHiddenSync();
          });
          return this;
        }

        /**
         * Ignore hidden directories
         *
         * @memberOf FileHound
         * @instance
         * @method
         * ignoreHiddenDirectories
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .ignoreHiddenDirectories()
         *   .find()
         *   .each(console.log); // array of files names that are not hidden directories
         */

      }, {
        key: 'ignoreHiddenDirectories',
        value: function ignoreHiddenDirectories() {
          this._ignoreHiddenDirectories = true;
          return this;
        }

        /**
         * Find sub-directories
         *
         * @memberOf FileHound
         * @instance
         * @method
         * directory
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .directory()
         *   .find()
         *   .each(console.log); // array of matching sub-directories
         */

      }, {
        key: 'directory',
        value: function directory() {
          this._directoriesOnly = true;
          return this;
        }

        /**
         * Find sockets
         *
         * @memberOf FileHound
         * @instance
         * @method
         * socket
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .socket()
         *   .find()
         *   .each(console.log); // array of matching sockets
         */

      }, {
        key: 'socket',
        value: function socket() {
          this.addFilter(function (file) {
            return file.isSocket();
          });
          return this;
        }

        /**
         * Specify the directory search depth. If set to zero, recursive searching
         * will be disabled
         *
         * @memberOf FileHound
         * @instance
         * @method
         * depth
         * @return a FileHound instance
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .depth(0)
         *   .find()
         *   .each(console.log); // array of files names only in the current directory
         */

      }, {
        key: 'depth',
        value: function depth(_depth) {
          this.maxDepth = _depth;
          return this;
        }

        /**
         * Asynchronously executes a file search.
         *
         * @memberOf FileHound
         * @instance
         * @method
         * find
         * @param {function} function - Optionally accepts a callback function
         * @return Returns a Promise of all matches. If the Promise fulfils,
         * the fulfilment value is an array of all matching files
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * filehound
         *   .find()
         *   .each(console.log);
         *
         * // using a callback
         * filehound
         *   .find((err, files) => {
         *      if (err) return console.error(err);
         *
         *      console.log(files);
         *   });
         */

      }, {
        key: 'find',
        value: function find(cb) {
          var _this3 = this;

          this._initFilters();

          var searchAsync = this._searchAsync.bind(this);
          var searches = _bluebird2.default.map(this.getSearchPaths(), searchAsync);

          return _bluebird2.default.all(searches).reduce(flatten).map(getFilename).catch(function (e) {
            _this3.emit('error', e);
            throw e;
          }).finally(function () {
            _this3.emit('end');
          }).asCallback(cb);
        }

        /**
         * Synchronously executes a file search.
         *
         * @memberOf FileHound
         * @instance
         * @method
         * findSync
         * @return Returns an array of all matching files
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.create();
         * const files = filehound.findSync();
         * console.log(files);
         *
         */

      }, {
        key: 'findSync',
        value: function findSync() {
          this._initFilters();

          var searchSync = this._searchSync.bind(this);

          return this.getSearchPaths().map(searchSync).reduce(flatten).map(getFilename);
        }
      }, {
        key: '_atMaxDepth',
        value: function _atMaxDepth(root, dir) {
          var depth = dir.getDepthSync() - root.getDepthSync();
          return isDefined(this.maxDepth) && depth > this.maxDepth;
        }
      }, {
        key: '_shouldFilterDirectory',
        value: function _shouldFilterDirectory(root, dir) {
          return this._atMaxDepth(root, dir) || this._ignoreHiddenDirectories && dir.isHiddenSync();
        }
      }, {
        key: '_newMatcher',
        value: function _newMatcher() {
          var isMatch = (0, _functions.compose)(this._filters);
          if (this.negateFilters) {
            return (0, _functions.negate)(isMatch);
          }
          return isMatch;
        }
      }, {
        key: '_initFilters',
        value: function _initFilters() {
          this._isMatch = this._newMatcher();
        }
      }, {
        key: '_searchSync',
        value: function _searchSync(dir) {
          this._sync = true;
          var root = _fileJs2.default.create(dir);
          var trackedPaths = [];
          var files = this._search(root, root, trackedPaths);
          return this._directoriesOnly ? trackedPaths.filter(this._isMatch) : files;
        }
      }, {
        key: '_searchAsync',
        value: function _searchAsync(dir) {
          var _this4 = this;

          var root = _fileJs2.default.create(dir);
          var trackedPaths = [];
          var pending = this._search(root, root, trackedPaths);

          return pending.then(function (files) {
            if (_this4._directoriesOnly) return trackedPaths.filter(_this4._isMatch);

            files.forEach(function (file) {
              _this4.emit('match', file.getName());
            });
            return files;
          });
        }
      }, {
        key: '_search',
        value: function _search(root, path, trackedPaths) {
          var _this5 = this;

          if (this._shouldFilterDirectory(root, path)) return [];

          var getFiles = this._sync ? path.getFilesSync.bind(path) : path.getFiles.bind(path);
          return getFiles().map(function (file) {
            if (file.isDirectorySync()) {
              if (!_this5._shouldFilterDirectory(root, file)) trackedPaths.push(file);

              return _this5._search(root, file, trackedPaths);
            }
            return file;
          }).reduce(flatten, []).filter(this._isMatch);
        }
      }, {
        key: 'getSearchPaths',
        value: function getSearchPaths() {
          var paths = isDefined(this.maxDepth) ? this._searchPaths : (0, _files.reducePaths)(this._searchPaths);

          return (0, _arrays.copy)(paths);
        }
      }], [{
        key: 'create',
        value: function create() {
          return new FileHound();
        }

        /**
         * Returns all matches from one of more FileHound instances
         *
         * @static
         * @memberOf FileHound
         * @method
         * any
         * @return a promise containing all matches. If the Promise fulfils,
         * the fulfilment value is an array of all matching files.
         * @example
         * import FileHound from 'filehound';
         *
         * const filehound = FileHound.any(fh1, fh2);
         */

      }, {
        key: 'any',
        value: function any() {
          var args = (0, _arrays.from)(arguments);
          return _bluebird2.default.all(args).reduce(flatten, []);
        }
      }]);

      return FileHound;
    }(_events.EventEmitter);

    exports.default = FileHound;