# Code coverage report for lib/utils/async.js

## Statements: 90% (9 / 10) Branches: 66.67% (4 / 6) Functions: 100% (3 / 3) Lines: 100% (8 / 8) Ignored: none

All files » lib/utils/ » async.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    181

    1

    1
    1
    1
    1
    1
    1

     module.exports = {

      /**
       */

      each: function (items, each, complete) {
        var total = items.length,
        completed = 0;
        items.forEach(function (item) {
          var called = false;
          each(item, function () {
            Iif (called) throw new Error("callback called twice");
            called = true;
            Eif (++completed === total && complete) complete();
          });
        });
      }
    }