Skip to content

Commit

Permalink
refactor: update fetch import for node v21+ compatibility (#2573)
Browse files Browse the repository at this point in the history
  • Loading branch information
avallete authored Apr 19, 2024
1 parent 0608204 commit 8d4169b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/quicktype-core/src/input/io/NodeIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { defined, exceptionToString } from "@glideapps/ts-necessities";
import { messageError, panic } from "../../index";

const isURL = require("is-url");
import fetch from "cross-fetch";

const fetch = (global as any).fetch ?? require("cross-fetch").default;

interface HttpHeaders {
[key: string]: string;
Expand Down

0 comments on commit 8d4169b

Please sign in to comment.