fix: resolve Biome formatting issues in background.ts and memories-grid.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
claude[bot] 2026-05-20 09:15:05 +00:00 committed by Ishaan Gupta
parent 68678d91b0
commit aec167cd90
2 changed files with 17 additions and 7 deletions

View file

@ -31,10 +31,15 @@ const PLATFORM_LABELS: Record<string, string> = {
function normalizePlatform(value?: string): string | undefined {
if (!value) return undefined
return value.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "")
return value
.toLowerCase()
.replace(/[^a-z0-9]+/g, "_")
.replace(/^_+|_+$/g, "")
}
function inferPlatformFromActionSource(actionSource: string): string | undefined {
function inferPlatformFromActionSource(
actionSource: string,
): string | undefined {
const source = actionSource.toLowerCase()
if (source.includes("chatgpt")) return "chatgpt"
if (source.includes("claude")) return "claude"
@ -146,9 +151,10 @@ export default defineBackground(() => {
content = data?.url || ""
}
const platform = normalizePlatform(data.sourcePlatform)
|| inferPlatformFromUrl(data.url)
|| inferPlatformFromActionSource(actionSource)
const platform =
normalizePlatform(data.sourcePlatform) ||
inferPlatformFromUrl(data.url) ||
inferPlatformFromActionSource(actionSource)
const platformLabel = platform
? data.sourcePlatformLabel || PLATFORM_LABELS[platform] || platform
: undefined

View file

@ -109,7 +109,9 @@ const EXTENSION_PLATFORM_LABELS: Record<string, string> = {
twitter: "X / Twitter",
}
function getExtensionSourceLabel(document: DocumentWithMemories): string | null {
function getExtensionSourceLabel(
document: DocumentWithMemories,
): string | null {
const metadata = document.metadata
if (!metadata || typeof metadata !== "object") return null
@ -1263,7 +1265,9 @@ const DocumentCard = memo(
day: "numeric",
year: "numeric",
})
return [sourceLabel, badge, date].filter(Boolean).join(" - ")
return [sourceLabel, badge, date]
.filter(Boolean)
.join(" - ")
})()}
</p>
</div>