Passed
Push — main ( b11d64...2eade5 )
by ABRAHAM
01:38
created

test/helper.js   A

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 34
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 20
mnd 0
bc 0
fnc 6
dl 0
loc 34
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
var q = require('q');
2
3
module.exports = {
4
5
  repeatText: function (text) {
6
    return text + ', ' + text;
7
  },
8
9
  capitalize: function (text) {
10
    return text[0].toUpperCase() + text.substring(1).toLowerCase();
11
  },
12
13
  exclaim: function (text) {
14
    return text + '!';
15
  },
16
17
  capitalizeAsync: function (text) {
18
    var deferred = q.defer();
19
    deferred.resolve(text[0].toUpperCase() + text.substring(1));
20
    return deferred.promise;
21
  },
22
23
  repeatTextAsync: function (text) {
24
    var deferred = q.defer();
25
    deferred.resolve(text + ', ' + text);
26
    return deferred.promise;
27
  },
28
29
  exclaimAsync: function (text) {
30
    var deferred = q.defer();
31
    deferred.resolve(text + '!');
32
    return deferred.promise;
33
  }
34
};