* @param {any} rawContext * @returns {ReusableStatusComment | null}
(rawContext)
| 135 | * @returns {ReusableStatusComment | null} |
| 136 | */ |
| 137 | function readReusableStatusComment(rawContext) { |
| 138 | const awContext = extractAwContextFromPayload(rawContext?.payload); |
| 139 | if (!awContext) { |
| 140 | return null; |
| 141 | } |
| 142 | |
| 143 | const rawId = awContext.status_comment_id ?? awContext.statusCommentId; |
| 144 | const id = rawId == null ? "" : String(rawId).trim(); |
| 145 | if (!id) { |
| 146 | return null; |
| 147 | } |
| 148 | |
| 149 | const rawUrl = awContext.status_comment_url ?? awContext.statusCommentUrl; |
| 150 | const url = typeof rawUrl === "string" ? rawUrl.trim() : ""; |
| 151 | const repo = parseRepoSlug(awContext.status_comment_repo ?? awContext.statusCommentRepo); |
| 152 | return { id, url, repo }; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * @param {any} rawContext |
no test coverage detected