all files / dist/utils/ ArrayUtils.js

100% Statements 14/14
100% Branches 4/4
100% Functions 6/6
100% Lines 13/13
1 function Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24    19×                  
"use strict";
var ArrayUtils = (function () {
    /* istanbul ignore next */ function ArrayUtils() {
    }
    ArrayUtils.isNullOrEmpty = function (a) {
        return !(a instanceof Array) || a.length === 0;
    };
    ArrayUtils.firstOrDefault = function (a, isMatch) {
        for (var i = 0; i < a.length; i++) {
            if (isMatch(a[i])) {
                return a[i];
            }
        }
        return null;
    };
    ArrayUtils.getUniqueItems = function (a) {
        return a.filter(function (item, index) { return a.indexOf(item) === index; });
    };
    return ArrayUtils;
}());
exports.ArrayUtils = ArrayUtils;
 
//# sourceMappingURL=ArrayUtils.js.map