(text: string)
| 110 | } |
| 111 | |
| 112 | export function indexSitesFixesConfig(text: string): SiteFixesIndex { |
| 113 | const {urls, offsets: offsetsGrouped} = extractURLsFromSiteFixesConfig(text); |
| 114 | const offsetMap = new Map<string, [number, number]>(); |
| 115 | const templates: string[] = []; |
| 116 | const offsets: Array<[number, number]> = [] |
| 117 | urls.forEach((block, i) => { |
| 118 | block.forEach((u) => { |
| 119 | templates.push(u); |
| 120 | offsets.push(offsetsGrouped[i]); |
| 121 | offsetMap.set(u, offsetsGrouped[i]); |
| 122 | }); |
| 123 | }); |
| 124 | const indexedList = indexURLTemplateList(templates, (_, i) => { |
| 125 | return offsets[i]; |
| 126 | }); |
| 127 | return indexedList; |
| 128 | } |
| 129 | |
| 130 | const siteFixesCache = new WeakMap<[number, number], any>(); |
| 131 |
no test coverage detected