(rawInput: string)
| 63 | } |
| 64 | |
| 65 | function parseCommandHeaderBody(rawInput: string): CommandHeaderBody { |
| 66 | const newlineIndex = rawInput.indexOf("\n"); |
| 67 | const header = newlineIndex === -1 ? rawInput : rawInput.slice(0, newlineIndex); |
| 68 | const rawBody = newlineIndex === -1 ? "" : rawInput.slice(newlineIndex + 1); |
| 69 | const body = trimOuterBlankLines(rawBody); |
| 70 | |
| 71 | return { |
| 72 | headerTokens: tokenizeCommandLine(header), |
| 73 | body: body.trim().length > 0 ? body : undefined, |
| 74 | bodyHadLeadingBlankLine: /^\s*\r?\n/.test(rawBody), |
| 75 | }; |
| 76 | } |
| 77 | |
| 78 | // Re-export MODEL_ABBREVIATIONS from constants for backwards compatibility |
| 79 | export { MODEL_ABBREVIATIONS }; |
no test coverage detected