(data: any)
| 47 | }; |
| 48 | |
| 49 | function 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 | |
| 66 | async function main() { |
| 67 | // Get document, or throw exception on error |