UNPKG

bookr-cli

Version:

A terminal-based CLI tool to book time in Jira using the Tempo plugin by parsing your current Git branch name

26 lines 808 B
/** * Extract text from JIRA comment (handles both string and structured formats) */ export function extractCommentText(comment) { if (!comment) return 'No comment'; if (typeof comment === 'string') { return comment; } // Handle structured comment format if (comment.content && Array.isArray(comment.content)) { const texts = []; for (const block of comment.content) { if (block.content && Array.isArray(block.content)) { for (const item of block.content) { if (item.text) { texts.push(item.text); } } } } return texts.join(' ').trim() || 'No comment'; } return 'No comment'; } //# sourceMappingURL=jira.js.map