travis-ci
4670 of 5656 branches covered (82.57%)
13 of 13 new or added lines in 2 files covered. (100.0%)
10412 of 11525 relevant lines covered (90.34%)
5850.54 hits per line
1 |
function KeySequence() { |
|
2 |
this.___lookup = {};
|
2,529 only 2387.2 ✔ |
3 |
} |
|
4 |
|
|
5 |
KeySequence.prototype = { |
326 only 2387.2 ✔ |
6 |
___nextKey: function(key) { |
|
7 |
// var len = key.length;
|
|
8 |
// var lastChar = key[len-1];
|
|
9 |
// if (lastChar === ']') {
|
|
10 |
// key = key.substring(0, len-2);
|
|
11 |
// }
|
|
12 |
var lookup = this.___lookup; |
4,850 only 2387.2 ✔ |
13 |
|
|
14 |
var currentIndex = lookup[key]++;
|
4,850 only 2387.2 ✔ |
15 |
if (!currentIndex) {
|
|
16 |
lookup[key] = 1;
|
4,620 only 2387.2 ✔ |
17 |
currentIndex = 0;
|
4,620 only 2387.2 ✔ |
18 |
return key;
|
4,620 only 2387.2 ✔ |
19 |
} else {
|
|
20 |
return key + "_" + currentIndex; |
230 only 2387.2 ✔ |
21 |
} |
|
22 |
} |
|
23 |
}; |
|
24 |
|
|
25 |
module.exports = KeySequence; |
326 only 2387.2 ✔ |