( line: string )
| 253 | const domain = parts[0]?.replace(/\.$/, "") || ""; |
| 254 | let ttl = ""; |
| 255 | let type = ""; |
| 256 | let value = ""; |
| 257 | |
| 258 | const inIndex = parts.findIndex((p) => p === "IN"); |
| 259 | if (inIndex >= 0 && inIndex + 2 < parts.length) { |
| 260 | if (inIndex > 1) ttl = parts[inIndex - 1] || ""; |
| 261 | type = parts[inIndex + 1] || ""; |
| 262 | value = parts.slice(inIndex + 2).join(" "); |
| 263 | } else if (parts.length >= 4) { |
| 264 | type = parts[parts.length - 2] || ""; |
| 265 | value = parts[parts.length - 1] || ""; |
| 266 | } |
| 267 | |
| 268 | return { domain, type, value, ttl }; |
| 269 | } |
| 270 | |
| 271 | async function formatDetailedDnsResults( |
| 272 | output: string, |
| 273 | args: string[] |
| 274 | ): Promise<string> { |
| 275 | if (!output || output.trim() === "") { |
| 276 | return `❌ <b>解析失败</b> |
| 277 | |
| 278 | 无记录或查询失败`; |
| 279 | } |
| 280 | |
| 281 | const lines = output.split("\n"); |
| 282 |
no outgoing calls
no test coverage detected