(data: any)
| 105 | }; |
| 106 | |
| 107 | function transform(data: any) { |
| 108 | const obj: Record<string, unknown> = {}; |
| 109 | for (const type in data) { |
| 110 | for (const name in data[type]) { |
| 111 | const domains = data[type][name].domains ?? []; |
| 112 | for (const domain of domains) { |
| 113 | obj[domain] = { |
| 114 | type, |
| 115 | name, |
| 116 | }; |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | return obj; |
| 122 | } |
| 123 | |
| 124 | async function main() { |
| 125 | // Get document, or throw exception on error |