coa 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/.npmignore +6 -0
  2. package/.nyc_output/1f2a0db5a6d6559149db56d397f47cfc.json +1 -0
  3. package/.nyc_output/75b82d38f2186df930141082076e11c6.json +1 -0
  4. package/.travis.yml +9 -0
  5. package/GNUmakefile +34 -0
  6. package/README.md +1 -19
  7. package/coverage/base.css +212 -0
  8. package/coverage/coa/index.html +93 -0
  9. package/coverage/coa/index.js.html +68 -0
  10. package/coverage/coa/lib/arg.js.html +239 -0
  11. package/coverage/coa/lib/cmd.js.html +1556 -0
  12. package/coverage/coa/lib/coaobject.js.html +365 -0
  13. package/coverage/coa/lib/coaparam.js.html +440 -0
  14. package/coverage/coa/lib/color.js.html +131 -0
  15. package/coverage/coa/lib/completion.js.html +593 -0
  16. package/coverage/coa/lib/index.html +197 -0
  17. package/coverage/coa/lib/index.js.html +107 -0
  18. package/coverage/coa/lib/opt.js.html +524 -0
  19. package/coverage/coa/lib/shell.js.html +107 -0
  20. package/coverage/index.html +106 -0
  21. package/coverage/prettify.css +1 -0
  22. package/coverage/prettify.js +1 -0
  23. package/coverage/sort-arrow-sprite.png +0 -0
  24. package/coverage/sorter.js +158 -0
  25. package/index.js +1 -1
  26. package/lib/arg.js +161 -44
  27. package/lib/cmd.js +547 -434
  28. package/lib/color.js +22 -19
  29. package/lib/completion.js +119 -161
  30. package/lib/index.js +10 -14
  31. package/lib/opt.js +313 -130
  32. package/lib/shell.js +13 -13
  33. package/package.json +14 -19
  34. package/qq.js +17 -0
  35. package/src/arg.coffee +130 -0
  36. package/src/cmd.coffee +456 -0
  37. package/src/color.coffee +25 -0
  38. package/src/completion.coffee +156 -0
  39. package/src/index.coffee +5 -0
  40. package/src/opt.coffee +243 -0
  41. package/src/shell.coffee +10 -0
  42. package/test/coa.js +496 -0
  43. package/test/mocha.opts +2 -0
  44. package/test/shell-test.js +60 -0
  45. package/tests/api-h.js +9 -0
  46. package/tests/h.js +6 -0
  47. package/LICENSE +0 -21
  48. package/lib/coaobject.js +0 -100
  49. package/lib/coaparam.js +0 -125
@@ -0,0 +1,440 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Code coverage report for coa/lib/coaparam.js</title>
5
+ <meta charset="utf-8" />
6
+ <link rel="stylesheet" href="../../prettify.css" />
7
+ <link rel="stylesheet" href="../../base.css" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+ <style type='text/css'>
10
+ .coverage-summary .sorter {
11
+ background-image: url(../../sort-arrow-sprite.png);
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <div class='wrapper'>
17
+ <div class='pad1'>
18
+ <h1>
19
+ <a href="../../index.html">All files</a> / <a href="index.html">coa/lib</a> coaparam.js
20
+ </h1>
21
+ <div class='clearfix'>
22
+ <div class='fl pad1y space-right2'>
23
+ <span class="strong">51.61% </span>
24
+ <span class="quiet">Statements</span>
25
+ <span class='fraction'>16/31</span>
26
+ </div>
27
+ <div class='fl pad1y space-right2'>
28
+ <span class="strong">0% </span>
29
+ <span class="quiet">Branches</span>
30
+ <span class='fraction'>0/8</span>
31
+ </div>
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">55.56% </span>
34
+ <span class="quiet">Functions</span>
35
+ <span class='fraction'>5/9</span>
36
+ </div>
37
+ <div class='fl pad1y space-right2'>
38
+ <span class="strong">51.61% </span>
39
+ <span class="quiet">Lines</span>
40
+ <span class='fraction'>16/31</span>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class='status-line medium'></div>
45
+ <pre><table class="coverage">
46
+ <tr><td class="line-count quiet">1
47
+ 2
48
+ 3
49
+ 4
50
+ 5
51
+ 6
52
+ 7
53
+ 8
54
+ 9
55
+ 10
56
+ 11
57
+ 12
58
+ 13
59
+ 14
60
+ 15
61
+ 16
62
+ 17
63
+ 18
64
+ 19
65
+ 20
66
+ 21
67
+ 22
68
+ 23
69
+ 24
70
+ 25
71
+ 26
72
+ 27
73
+ 28
74
+ 29
75
+ 30
76
+ 31
77
+ 32
78
+ 33
79
+ 34
80
+ 35
81
+ 36
82
+ 37
83
+ 38
84
+ 39
85
+ 40
86
+ 41
87
+ 42
88
+ 43
89
+ 44
90
+ 45
91
+ 46
92
+ 47
93
+ 48
94
+ 49
95
+ 50
96
+ 51
97
+ 52
98
+ 53
99
+ 54
100
+ 55
101
+ 56
102
+ 57
103
+ 58
104
+ 59
105
+ 60
106
+ 61
107
+ 62
108
+ 63
109
+ 64
110
+ 65
111
+ 66
112
+ 67
113
+ 68
114
+ 69
115
+ 70
116
+ 71
117
+ 72
118
+ 73
119
+ 74
120
+ 75
121
+ 76
122
+ 77
123
+ 78
124
+ 79
125
+ 80
126
+ 81
127
+ 82
128
+ 83
129
+ 84
130
+ 85
131
+ 86
132
+ 87
133
+ 88
134
+ 89
135
+ 90
136
+ 91
137
+ 92
138
+ 93
139
+ 94
140
+ 95
141
+ 96
142
+ 97
143
+ 98
144
+ 99
145
+ 100
146
+ 101
147
+ 102
148
+ 103
149
+ 104
150
+ 105
151
+ 106
152
+ 107
153
+ 108
154
+ 109
155
+ 110
156
+ 111
157
+ 112
158
+ 113
159
+ 114
160
+ 115
161
+ 116
162
+ 117
163
+ 118
164
+ 119
165
+ 120
166
+ 121
167
+ 122
168
+ 123
169
+ 124
170
+ 125
171
+ 126</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
172
+ <span class="cline-any cline-neutral">&nbsp;</span>
173
+ <span class="cline-any cline-yes">1x</span>
174
+ <span class="cline-any cline-neutral">&nbsp;</span>
175
+ <span class="cline-any cline-yes">1x</span>
176
+ <span class="cline-any cline-neutral">&nbsp;</span>
177
+ <span class="cline-any cline-neutral">&nbsp;</span>
178
+ <span class="cline-any cline-neutral">&nbsp;</span>
179
+ <span class="cline-any cline-neutral">&nbsp;</span>
180
+ <span class="cline-any cline-neutral">&nbsp;</span>
181
+ <span class="cline-any cline-neutral">&nbsp;</span>
182
+ <span class="cline-any cline-neutral">&nbsp;</span>
183
+ <span class="cline-any cline-neutral">&nbsp;</span>
184
+ <span class="cline-any cline-neutral">&nbsp;</span>
185
+ <span class="cline-any cline-neutral">&nbsp;</span>
186
+ <span class="cline-any cline-neutral">&nbsp;</span>
187
+ <span class="cline-any cline-neutral">&nbsp;</span>
188
+ <span class="cline-any cline-neutral">&nbsp;</span>
189
+ <span class="cline-any cline-neutral">&nbsp;</span>
190
+ <span class="cline-any cline-neutral">&nbsp;</span>
191
+ <span class="cline-any cline-neutral">&nbsp;</span>
192
+ <span class="cline-any cline-neutral">&nbsp;</span>
193
+ <span class="cline-any cline-neutral">&nbsp;</span>
194
+ <span class="cline-any cline-neutral">&nbsp;</span>
195
+ <span class="cline-any cline-yes">1x</span>
196
+ <span class="cline-any cline-neutral">&nbsp;</span>
197
+ <span class="cline-any cline-yes">32x</span>
198
+ <span class="cline-any cline-neutral">&nbsp;</span>
199
+ <span class="cline-any cline-yes">32x</span>
200
+ <span class="cline-any cline-yes">32x</span>
201
+ <span class="cline-any cline-yes">32x</span>
202
+ <span class="cline-any cline-yes">32x</span>
203
+ <span class="cline-any cline-neutral">&nbsp;</span>
204
+ <span class="cline-any cline-neutral">&nbsp;</span>
205
+ <span class="cline-any cline-neutral">&nbsp;</span>
206
+ <span class="cline-any cline-neutral">&nbsp;</span>
207
+ <span class="cline-any cline-neutral">&nbsp;</span>
208
+ <span class="cline-any cline-neutral">&nbsp;</span>
209
+ <span class="cline-any cline-neutral">&nbsp;</span>
210
+ <span class="cline-any cline-neutral">&nbsp;</span>
211
+ <span class="cline-any cline-neutral">&nbsp;</span>
212
+ <span class="cline-any cline-yes">9x</span>
213
+ <span class="cline-any cline-yes">9x</span>
214
+ <span class="cline-any cline-neutral">&nbsp;</span>
215
+ <span class="cline-any cline-neutral">&nbsp;</span>
216
+ <span class="cline-any cline-neutral">&nbsp;</span>
217
+ <span class="cline-any cline-neutral">&nbsp;</span>
218
+ <span class="cline-any cline-neutral">&nbsp;</span>
219
+ <span class="cline-any cline-neutral">&nbsp;</span>
220
+ <span class="cline-any cline-neutral">&nbsp;</span>
221
+ <span class="cline-any cline-neutral">&nbsp;</span>
222
+ <span class="cline-any cline-yes">3x</span>
223
+ <span class="cline-any cline-yes">3x</span>
224
+ <span class="cline-any cline-neutral">&nbsp;</span>
225
+ <span class="cline-any cline-neutral">&nbsp;</span>
226
+ <span class="cline-any cline-neutral">&nbsp;</span>
227
+ <span class="cline-any cline-neutral">&nbsp;</span>
228
+ <span class="cline-any cline-neutral">&nbsp;</span>
229
+ <span class="cline-any cline-neutral">&nbsp;</span>
230
+ <span class="cline-any cline-neutral">&nbsp;</span>
231
+ <span class="cline-any cline-neutral">&nbsp;</span>
232
+ <span class="cline-any cline-neutral">&nbsp;</span>
233
+ <span class="cline-any cline-neutral">&nbsp;</span>
234
+ <span class="cline-any cline-neutral">&nbsp;</span>
235
+ <span class="cline-any cline-neutral">&nbsp;</span>
236
+ <span class="cline-any cline-neutral">&nbsp;</span>
237
+ <span class="cline-any cline-yes">1x</span>
238
+ <span class="cline-any cline-yes">1x</span>
239
+ <span class="cline-any cline-neutral">&nbsp;</span>
240
+ <span class="cline-any cline-neutral">&nbsp;</span>
241
+ <span class="cline-any cline-neutral">&nbsp;</span>
242
+ <span class="cline-any cline-neutral">&nbsp;</span>
243
+ <span class="cline-any cline-neutral">&nbsp;</span>
244
+ <span class="cline-any cline-neutral">&nbsp;</span>
245
+ <span class="cline-any cline-neutral">&nbsp;</span>
246
+ <span class="cline-any cline-neutral">&nbsp;</span>
247
+ <span class="cline-any cline-neutral">&nbsp;</span>
248
+ <span class="cline-any cline-neutral">&nbsp;</span>
249
+ <span class="cline-any cline-yes">1x</span>
250
+ <span class="cline-any cline-yes">1x</span>
251
+ <span class="cline-any cline-neutral">&nbsp;</span>
252
+ <span class="cline-any cline-neutral">&nbsp;</span>
253
+ <span class="cline-any cline-neutral">&nbsp;</span>
254
+ <span class="cline-any cline-neutral">&nbsp;</span>
255
+ <span class="cline-any cline-neutral">&nbsp;</span>
256
+ <span class="cline-any cline-neutral">&nbsp;</span>
257
+ <span class="cline-any cline-neutral">&nbsp;</span>
258
+ <span class="cline-any cline-neutral">&nbsp;</span>
259
+ <span class="cline-any cline-neutral">&nbsp;</span>
260
+ <span class="cline-any cline-no">&nbsp;</span>
261
+ <span class="cline-any cline-no">&nbsp;</span>
262
+ <span class="cline-any cline-neutral">&nbsp;</span>
263
+ <span class="cline-any cline-neutral">&nbsp;</span>
264
+ <span class="cline-any cline-no">&nbsp;</span>
265
+ <span class="cline-any cline-no">&nbsp;</span>
266
+ <span class="cline-any cline-neutral">&nbsp;</span>
267
+ <span class="cline-any cline-no">&nbsp;</span>
268
+ <span class="cline-any cline-no">&nbsp;</span>
269
+ <span class="cline-any cline-neutral">&nbsp;</span>
270
+ <span class="cline-any cline-no">&nbsp;</span>
271
+ <span class="cline-any cline-no">&nbsp;</span>
272
+ <span class="cline-any cline-no">&nbsp;</span>
273
+ <span class="cline-any cline-neutral">&nbsp;</span>
274
+ <span class="cline-any cline-neutral">&nbsp;</span>
275
+ <span class="cline-any cline-neutral">&nbsp;</span>
276
+ <span class="cline-any cline-neutral">&nbsp;</span>
277
+ <span class="cline-any cline-neutral">&nbsp;</span>
278
+ <span class="cline-any cline-neutral">&nbsp;</span>
279
+ <span class="cline-any cline-neutral">&nbsp;</span>
280
+ <span class="cline-any cline-neutral">&nbsp;</span>
281
+ <span class="cline-any cline-neutral">&nbsp;</span>
282
+ <span class="cline-any cline-neutral">&nbsp;</span>
283
+ <span class="cline-any cline-no">&nbsp;</span>
284
+ <span class="cline-any cline-neutral">&nbsp;</span>
285
+ <span class="cline-any cline-neutral">&nbsp;</span>
286
+ <span class="cline-any cline-no">&nbsp;</span>
287
+ <span class="cline-any cline-no">&nbsp;</span>
288
+ <span class="cline-any cline-neutral">&nbsp;</span>
289
+ <span class="cline-any cline-no">&nbsp;</span>
290
+ <span class="cline-any cline-no">&nbsp;</span>
291
+ <span class="cline-any cline-neutral">&nbsp;</span>
292
+ <span class="cline-any cline-no">&nbsp;</span>
293
+ <span class="cline-any cline-neutral">&nbsp;</span>
294
+ <span class="cline-any cline-neutral">&nbsp;</span>
295
+ <span class="cline-any cline-neutral">&nbsp;</span>
296
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
297
+ &nbsp;
298
+ const fs = require('fs');
299
+ &nbsp;
300
+ const CoaObject = require('./coaobject');
301
+ &nbsp;
302
+ /**
303
+ * COA Parameter
304
+ *
305
+ * Base class for options and arguments
306
+ *
307
+ * --------|-----|-----|-----
308
+ * | Cmd | Opt | Arg
309
+ * --------|-----|-----|-----
310
+ * arr | | ✓ | ✓
311
+ * req | | ✓ | ✓
312
+ * val | | ✓ | ✓
313
+ * def | | ✓ | ✓
314
+ * input | | ✓ | ✓
315
+ * output | | ✓ | ✓
316
+ *
317
+ * @class CoaParam
318
+ * @extends CoaObject
319
+ */
320
+ module.exports = class CoaParam extends CoaObject {
321
+ constructor(cmd) {
322
+ super(cmd);
323
+ &nbsp;
324
+ this._arr = false;
325
+ this._req = false;
326
+ this._val = undefined;
327
+ this._def = undefined;
328
+ }
329
+ &nbsp;
330
+ /**
331
+ * Makes a param accepts multiple values.
332
+ * Otherwise, the value will be used by the latter passed.
333
+ *
334
+ * @returns {COA.CoaParam} - this instance (for chainability)
335
+ */
336
+ arr() {
337
+ this._arr = true;
338
+ return this;
339
+ }
340
+ &nbsp;
341
+ /**
342
+ * Makes a param required.
343
+ *
344
+ * @returns {COA.CoaParam} - this instance (for chainability)
345
+ */
346
+ req() {
347
+ this._req = true;
348
+ return this;
349
+ }
350
+ &nbsp;
351
+ /**
352
+ * Set a validation (or value) function for param.
353
+ * Value from command line passes through before becoming available from API.
354
+ * Using for validation and convertion simple types to any values.
355
+ *
356
+ * @param {Function} val - validating function,
357
+ * invoked in the context of option instance
358
+ * and has one parameter with value from command line.
359
+ * @returns {COA.CoaParam} - this instance (for chainability)
360
+ */
361
+ val(val) {
362
+ this._val = val;
363
+ return this;
364
+ }
365
+ &nbsp;
366
+ /**
367
+ * Set a default value for param.
368
+ * Default value passed through validation function as ordinary value.
369
+ *
370
+ * @param {*} def - default value of function generator
371
+ * @returns {COA.CoaParam} - this instance (for chainability)
372
+ */
373
+ def(def) {
374
+ this._def = def;
375
+ return this;
376
+ }
377
+ &nbsp;
378
+ /**
379
+ * Make option value inputting stream.
380
+ * It's add useful validation and shortcut for STDIN.
381
+ *
382
+ * @returns {COA.CoaParam} - this instance (for chainability)
383
+ */
384
+ <span class="fstat-no" title="function not covered" > in</span>put() {
385
+ <span class="cstat-no" title="statement not covered" > process.stdin.pause();</span>
386
+ <span class="cstat-no" title="statement not covered" > return this</span>
387
+ .def(process.stdin)
388
+ .val(<span class="fstat-no" title="function not covered" >fu</span>nction(v) {
389
+ <span class="cstat-no" title="statement not covered" > if(typeof v !== 'string')</span>
390
+ <span class="cstat-no" title="statement not covered" > return v;</span>
391
+ &nbsp;
392
+ <span class="cstat-no" title="statement not covered" > if(v === '-')</span>
393
+ <span class="cstat-no" title="statement not covered" > return process.stdin;</span>
394
+ &nbsp;
395
+ const s = <span class="cstat-no" title="statement not covered" >fs.createReadStream(v, { encoding : 'utf8' });</span>
396
+ <span class="cstat-no" title="statement not covered" > s.pause();</span>
397
+ <span class="cstat-no" title="statement not covered" > return s;</span>
398
+ });
399
+ }
400
+ &nbsp;
401
+ /**
402
+ * Make option value outputing stream.
403
+ * It's add useful validation and shortcut for STDOUT.
404
+ *
405
+ * @returns {COA.CoaParam} - this instance (for chainability)
406
+ */
407
+ <span class="fstat-no" title="function not covered" > ou</span>tput() {
408
+ <span class="cstat-no" title="statement not covered" > return this</span>
409
+ .def(process.stdout)
410
+ .val(<span class="fstat-no" title="function not covered" >fu</span>nction(v) {
411
+ <span class="cstat-no" title="statement not covered" > if(typeof v !== 'string')</span>
412
+ <span class="cstat-no" title="statement not covered" > return v;</span>
413
+ &nbsp;
414
+ <span class="cstat-no" title="statement not covered" > if(v === '-')</span>
415
+ <span class="cstat-no" title="statement not covered" > return process.stdout;</span>
416
+ &nbsp;
417
+ <span class="cstat-no" title="statement not covered" > return fs.createWriteStream(v, { encoding : 'utf8' });</span>
418
+ });
419
+ }
420
+ };
421
+ &nbsp;</pre></td></tr>
422
+ </table></pre>
423
+ <div class='push'></div><!-- for sticky footer -->
424
+ </div><!-- /wrapper -->
425
+ <div class='footer quiet pad2 space-top1 center small'>
426
+ Code coverage
427
+ generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
428
+ </div>
429
+ </div>
430
+ <script src="../../prettify.js"></script>
431
+ <script>
432
+ window.onload = function () {
433
+ if (typeof prettyPrint === 'function') {
434
+ prettyPrint();
435
+ }
436
+ };
437
+ </script>
438
+ <script src="../../sorter.js"></script>
439
+ </body>
440
+ </html>
@@ -0,0 +1,131 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Code coverage report for coa/lib/color.js</title>
5
+ <meta charset="utf-8" />
6
+ <link rel="stylesheet" href="../../prettify.css" />
7
+ <link rel="stylesheet" href="../../base.css" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+ <style type='text/css'>
10
+ .coverage-summary .sorter {
11
+ background-image: url(../../sort-arrow-sprite.png);
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <div class='wrapper'>
17
+ <div class='pad1'>
18
+ <h1>
19
+ <a href="../../index.html">All files</a> / <a href="index.html">coa/lib</a> color.js
20
+ </h1>
21
+ <div class='clearfix'>
22
+ <div class='fl pad1y space-right2'>
23
+ <span class="strong">100% </span>
24
+ <span class="quiet">Statements</span>
25
+ <span class='fraction'>3/3</span>
26
+ </div>
27
+ <div class='fl pad1y space-right2'>
28
+ <span class="strong">100% </span>
29
+ <span class="quiet">Branches</span>
30
+ <span class='fraction'>0/0</span>
31
+ </div>
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Functions</span>
35
+ <span class='fraction'>1/1</span>
36
+ </div>
37
+ <div class='fl pad1y space-right2'>
38
+ <span class="strong">100% </span>
39
+ <span class="quiet">Lines</span>
40
+ <span class='fraction'>2/2</span>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class='status-line high'></div>
45
+ <pre><table class="coverage">
46
+ <tr><td class="line-count quiet">1
47
+ 2
48
+ 3
49
+ 4
50
+ 5
51
+ 6
52
+ 7
53
+ 8
54
+ 9
55
+ 10
56
+ 11
57
+ 12
58
+ 13
59
+ 14
60
+ 15
61
+ 16
62
+ 17
63
+ 18
64
+ 19
65
+ 20
66
+ 21
67
+ 22
68
+ 23</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
69
+ <span class="cline-any cline-neutral">&nbsp;</span>
70
+ <span class="cline-any cline-yes">1x</span>
71
+ <span class="cline-any cline-neutral">&nbsp;</span>
72
+ <span class="cline-any cline-neutral">&nbsp;</span>
73
+ <span class="cline-any cline-neutral">&nbsp;</span>
74
+ <span class="cline-any cline-neutral">&nbsp;</span>
75
+ <span class="cline-any cline-neutral">&nbsp;</span>
76
+ <span class="cline-any cline-neutral">&nbsp;</span>
77
+ <span class="cline-any cline-neutral">&nbsp;</span>
78
+ <span class="cline-any cline-neutral">&nbsp;</span>
79
+ <span class="cline-any cline-neutral">&nbsp;</span>
80
+ <span class="cline-any cline-neutral">&nbsp;</span>
81
+ <span class="cline-any cline-neutral">&nbsp;</span>
82
+ <span class="cline-any cline-neutral">&nbsp;</span>
83
+ <span class="cline-any cline-neutral">&nbsp;</span>
84
+ <span class="cline-any cline-neutral">&nbsp;</span>
85
+ <span class="cline-any cline-neutral">&nbsp;</span>
86
+ <span class="cline-any cline-neutral">&nbsp;</span>
87
+ <span class="cline-any cline-neutral">&nbsp;</span>
88
+ <span class="cline-any cline-neutral">&nbsp;</span>
89
+ <span class="cline-any cline-yes">4x</span>
90
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
91
+ &nbsp;
92
+ const colors = {
93
+ black : '30',
94
+ dgray : '1;30',
95
+ red : '31',
96
+ lred : '1;31',
97
+ green : '32',
98
+ lgreen : '1;32',
99
+ brown : '33',
100
+ yellow : '1;33',
101
+ blue : '34',
102
+ lblue : '1;34',
103
+ purple : '35',
104
+ lpurple : '1;35',
105
+ cyan : '36',
106
+ lcyan : '1;36',
107
+ lgray : '37',
108
+ white : '1;37'
109
+ };
110
+ &nbsp;
111
+ module.exports = (c, str) =&gt; `\x1B[${colors[c]}m${str}\x1B[m`;
112
+ &nbsp;</pre></td></tr>
113
+ </table></pre>
114
+ <div class='push'></div><!-- for sticky footer -->
115
+ </div><!-- /wrapper -->
116
+ <div class='footer quiet pad2 space-top1 center small'>
117
+ Code coverage
118
+ generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
119
+ </div>
120
+ </div>
121
+ <script src="../../prettify.js"></script>
122
+ <script>
123
+ window.onload = function () {
124
+ if (typeof prettyPrint === 'function') {
125
+ prettyPrint();
126
+ }
127
+ };
128
+ </script>
129
+ <script src="../../sorter.js"></script>
130
+ </body>
131
+ </html>