(raw = '')
| 110 | } |
| 111 | |
| 112 | function splitRawMessage(raw = '') { |
| 113 | const source = String(raw || ''); |
| 114 | if (!source) { |
| 115 | return { headerText: '', bodyText: '' }; |
| 116 | } |
| 117 | |
| 118 | const normalized = source.replace(/\r\n/g, '\n'); |
| 119 | const separatorIndex = normalized.indexOf('\n\n'); |
| 120 | if (separatorIndex === -1) { |
| 121 | return { headerText: normalized, bodyText: '' }; |
| 122 | } |
| 123 | |
| 124 | return { |
| 125 | headerText: normalized.slice(0, separatorIndex), |
| 126 | bodyText: normalized.slice(separatorIndex + 2), |
| 127 | }; |
| 128 | } |
| 129 | |
| 130 | function parseRawHeaders(headerText = '') { |
| 131 | const headers = {}; |
no outgoing calls
no test coverage detected