MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / transform

Function transform

apps/worker/scripts/get-referrers.ts:49–64  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

47};
48
49function transform(data: any) {
50 const obj: Record<string, unknown> = {};
51 for (const type in data) {
52 for (const name in data[type]) {
53 const domains = data[type][name].domains ?? [];
54 for (const domain of domains) {
55 obj[domain] = {
56 type,
57 name,
58 };
59 }
60 }
61 }
62
63 return obj;
64}
65
66async function main() {
67 // Get document, or throw exception on error

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected