refactor: dedupe bluebubbles send record helper

This commit is contained in:
Peter Steinberger
2026-04-06 22:49:40 +01:00
parent b7e249fc08
commit 92e3299793

View File

@@ -1,3 +1,4 @@
import { asRecord } from "./monitor-normalize.js";
import { normalizeBlueBubblesHandle, parseBlueBubblesTarget } from "./targets.js";
import type { BlueBubblesSendTarget } from "./types.js";
@@ -24,11 +25,6 @@ export function extractBlueBubblesMessageId(payload: unknown): string {
return "unknown";
}
const asRecord = (value: unknown): Record<string, unknown> | null =>
value && typeof value === "object" && !Array.isArray(value)
? (value as Record<string, unknown>)
: null;
const record = payload as Record<string, unknown>;
const dataRecord = asRecord(record.data);
const resultRecord = asRecord(record.result);