Files
renovate/lib/modules/datasource/custom/formats/json.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

17 lines
573 B
TypeScript

import { readLocalFile } from '../../../../util/fs/index.ts';
import type { Http } from '../../../../util/http/index.ts';
import type { CustomDatasourceFetcher } from './types.ts';
export class JSONFetcher implements CustomDatasourceFetcher {
async fetch(http: Http, registryURL: string): Promise<unknown> {
const response = await http.getJsonUnchecked(registryURL);
return response.body;
}
async readFile(registryURL: string): Promise<unknown> {
const fileContent = await readLocalFile(registryURL, 'utf8');
return JSON.parse(fileContent!);
}
}