// THIS FILE WAS AUTO-GENERATED
// Source: lib/templates/backends/typescriptGenerator/builtinFunctions/fetchJSON.mustache
// Any manual changes will be lost.
import { apply } from "typestache";
export const template = `async function _builtinFetchJSON(url: string, args: RequestInit = {}): Promise<any> {
  const result = await fetch(url, args);
  try {
    const json = await result.json();
    return json;
  } catch (e) {
    throw new Error(\`Failed to parse JSON from $\{url\}: $\{e\}\`);
  }
}`;
const render = (args) => {
    return apply(template, args);
};
export default render;
