• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leizongmin / js-css-filter / #2267

06 Jan 2026 02:46PM UTC coverage: 95.781% (-0.6%) from 96.344%
#2267

push

58 of 78 branches covered (74.36%)

454 of 474 relevant lines covered (95.78%)

9.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

34.62
/lib/util.js
1
module.exports = {
1✔
2
  indexOf: function (arr, item) {
3
    var i, j;
×
4
    if (Array.prototype.indexOf) {
×
5
      return arr.indexOf(item);
×
6
    }
7
    for (i = 0, j = arr.length; i < j; i++) {
×
8
      if (arr[i] === item) {
×
9
        return i;
×
10
      }
11
    }
12
    return -1;
×
13
  },
14
  forEach: function (arr, fn, scope) {
15
    var i, j;
×
16
    if (Array.prototype.forEach) {
×
17
      return arr.forEach(fn, scope);
×
18
    }
19
    for (i = 0, j = arr.length; i < j; i++) {
×
20
      fn.call(scope, arr[i], i, arr);
×
21
    }
22
  },
23
  trim: function (str) {
24
    if (String.prototype.trim) {
109!
25
      return str.trim();
109✔
26
    }
27
    return str.replace(/(^\s*)|(\s*$)/g, '');
×
28
  },
29
  trimRight: function (str) {
30
    if (String.prototype.trimRight) {
11!
31
      return str.trimRight();
11✔
32
    }
33
    return str.replace(/(\s*$)/g, '');
×
34
  }
35
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc