Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/typescript-eslint/…
Browse files Browse the repository at this point in the history
…parser-7.7.0
  • Loading branch information
dvdsgl authored Apr 28, 2024
2 parents 6bac348 + 49e9e03 commit 802ebd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .deepsource.toml

This file was deleted.

7 changes: 5 additions & 2 deletions packages/quicktype-core/src/input/io/NodeIO.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import * as fs from "fs";
import { defined, exceptionToString } from "@glideapps/ts-necessities";
import { Readable } from "readable-stream";
import { isNode } from "browser-or-node";
import _fetch from "cross-fetch";
import { getStream } from "./get-stream";
import { defined, exceptionToString } from "@glideapps/ts-necessities";
import { messageError, panic } from "../../index";

const isURL = require("is-url");

const fetch = (global as any).fetch ?? require("cross-fetch").default;
// Only use cross-fetch in CI
const fetch = process.env.CI ? _fetch : (global as any).fetch ?? _fetch;

interface HttpHeaders {
[key: string]: string;
Expand Down Expand Up @@ -41,6 +43,7 @@ export async function readableFromFileOrURL(fileOrURL: string, httpHeaders?: str
const response = await fetch(fileOrURL, {
headers: parseHeaders(httpHeaders)
});

return defined(response.body) as unknown as Readable;
} else if (isNode) {
if (fileOrURL === "-") {
Expand Down

0 comments on commit 802ebd5

Please sign in to comment.