Total Complexity | 4 |
Complexity/F | 4 |
Lines of Code | 16 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
8 | function splitMessage(message) { |
||
9 | const expression = /[^\s"]+|"([^"]*)"/gi; |
||
10 | const result = []; |
||
11 | let match; |
||
12 | do { |
||
13 | match = expression.exec(message); |
||
14 | if (match != null) { |
||
|
|||
15 | result.push(match[1] ? match[1] : match[0]); |
||
16 | } |
||
17 | } while (match != null); |
||
18 | |||
19 | return result; |
||
20 | } |
||
21 | |||
22 | |||
23 | exports.splitMessage = splitMessage; |
||
24 |