Total Complexity | 6 |
Complexity/F | 1 |
Lines of Code | 34 |
Function Count | 6 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 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 | }; |