Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 23 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import Generator from './Base'; |
||
2 | |||
3 | /** |
||
4 | * Generates a random paragraph. |
||
5 | * @description a couple of sentences |
||
6 | * @returns {string} paragraph |
||
7 | * @requires int |
||
8 | * @requires sentence |
||
9 | * @generator |
||
10 | */ |
||
11 | export default class ParagraphGenerator extends Generator { |
||
12 | generate() { |
||
13 | // eslint-disable-next-line no-magic-numbers |
||
14 | const count = this.fatum.int(2, 8); |
||
15 | const text = []; |
||
16 | |||
17 | for (let i = 0; i < count; i++) { |
||
18 | text.push(this.fatum.sentence()); |
||
19 | } |
||
20 | |||
21 | return text.join(' '); |
||
22 | } |
||
23 | } |
||
24 |