in client/src/typeahead/CapiTypeaheadHelpers.ts [993:1012]
private async getJson<T>(
path: string,
_params: Record<string, string>,
signal?: AbortSignal
): Promise<T> {
const params = new URLSearchParams({
..._params,
"api-key": this.apiKey,
});
const url = `${this.baseUrl}/${path}?${params.toString()}`;
const maybeCachedResult = this.cache.get(url);
if (maybeCachedResult) {
return maybeCachedResult as T;
}
const result = (await (await fetch(url, { signal })).json()) as T;
this.cache.put(url, result);
return result;
}