(url: string)
| 159 | } |
| 160 | |
| 161 | private async read(url: string): Promise<{ text: string; cachedAt?: string } | null> { |
| 162 | const file = this.cacheFile(url); |
| 163 | try { |
| 164 | const [text, stats] = await Promise.all([ |
| 165 | readFile(file, "utf8"), |
| 166 | stat(file) |
| 167 | ]); |
| 168 | return { text, cachedAt: stats.mtime.toISOString() }; |
| 169 | } catch { |
| 170 | return null; |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | function sortKeys(record: Record<string, string>): Record<string, string> { |