--- import { type Summary, VerificationResult } from "@lib/pgp/summary"; import { PublicKey } from "openpgp"; type Props = { summary: Summary; rowspan?: number }; const { summary, rowspan } = Astro.props; const [type, _, info] = summary; let name: string = ""; let email: string = ""; let fingerprint: string = ""; let trust: number | undefined = NaN; let commiter: boolean | undefined = undefined; let revoked: boolean | undefined = undefined; let keyType: "primary" | "sub" | "" = ""; switch (type) { case VerificationResult.MISSING_KEY: fingerprint = typeof info.keyID === "string" ? info.keyID : info.keyID.toHex(); break; case VerificationResult.TRUSTED_KEY: const match = info.userID[0].match(/^(.*?)\s*(?:\((.*?)\))?\s*<(.+?)>$/); if (match) { name = match[1]; email = match[3]; } fingerprint = info.key.getFingerprint(); trust = info.trust; keyType = info.key instanceof PublicKey ? "primary" : "sub"; break; } const names = name.split(/\s/); const firstName = names[0]; const lastName = names.length > 1 ? ` ${names[names.length - 1]}` : ""; ---