• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ota-meshi / eslint-plugin-json-schema-validator / 21108295337

18 Jan 2026 07:47AM UTC coverage: 89.746% (+2.4%) from 87.363%
21108295337

push

github

web-flow
Bundle using tsdown (#452)

* Initial plan

* Implement bundling with tsdown

Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>

* Add comment explaining failOnWarn configuration

Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>

* revert and fix

* fix

* update

* downgrade

* fix

* fix

* remove esbuild-register and fix

* update

* test

* fix

* Update package.json

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: update cover script, replace nyc with c8

* update

* fix

* fix: ensure Node.js version is set for test job

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
Co-authored-by: yosuke ota <otameshiyo23@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

584 of 680 branches covered (85.88%)

Branch coverage included in aggregate %.

83 of 96 new or added lines in 15 files covered. (86.46%)

149 existing lines in 10 files now uncovered.

2558 of 2821 relevant lines covered (90.68%)

234.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.1
/src/utils/http-client/get-modules/http.ts
1
import type { RequestOptions } from "https";
1✔
2
import https from "https";
1✔
3
import http from "http";
1✔
4
// @ts-expect-error -- no types
1✔
5
import tunnel from "tunnel-agent";
1✔
6

1✔
7
const TIMEOUT = 60000;
1✔
8

1✔
9
/**
1✔
10
 * GET Method using http modules.
1✔
11
 */
1✔
12
export default function get(
18✔
13
  url: string,
3✔
14
  options?: RequestOptions,
3✔
15
): Promise<string> {
3✔
16
  return get0(url, options, 0);
3✔
17
}
3✔
18

1✔
19
/** Implementation of HTTP GET method */
19✔
20
function get0(
5✔
21
  url: string,
5✔
22
  options: RequestOptions | undefined,
5✔
23
  redirectCount: number,
5✔
24
): Promise<string> {
5✔
25
  const client = url.startsWith("https") ? https : http;
5!
26
  const parsedOptions = parseUrlAndOptions(url, options || {});
5!
27

5✔
28
  return new Promise((resolve, reject) => {
5✔
29
    let result = "";
5✔
30
    const req = client.get(parsedOptions, (res) => {
5✔
31
      res.on("data", (chunk) => {
498✔
32
        result += chunk;
11✔
33
      });
19✔
34
      res.on("end", () => {
19✔
35
        if (
5✔
36
          res.statusCode &&
5✔
37
          res.statusCode >= 300 &&
5✔
38
          res.statusCode < 400 &&
2✔
39
          redirectCount < 3 // max redirect
5✔
40
        ) {
5✔
41
          const location = res.headers.location!;
2✔
42
          try {
2!
43
            const redirectUrl = new URL(location, url).toString();
2✔
44
            resolve(get0(redirectUrl, options, redirectCount + 1));
2✔
UNCOV
45
          } catch (e) {
×
46
            reject(e);
×
UNCOV
47
          }
×
UNCOV
48
          return;
×
UNCOV
49
        }
✔
UNCOV
50
        resolve(result);
×
51
      });
3✔
52
    });
5✔
53
    req.on("error", (e) => {
5✔
54
      reject(e);
×
UNCOV
55
    });
×
56
    req.setTimeout(TIMEOUT, function handleRequestTimeout() {
19✔
57
      if (req.destroy) {
×
58
        req.destroy();
×
UNCOV
59
      } else {
×
60
        req.abort();
×
UNCOV
61
      }
×
62
      reject(new Error(`Timeout of ${TIMEOUT}ms exceeded`));
×
UNCOV
63
    });
×
UNCOV
64
  });
×
65
}
19✔
66

19✔
67
/** Parse URL and options */
19✔
68
function parseUrlAndOptions(urlStr: string, baseOptions: RequestOptions) {
5!
69
  const url = new URL(urlStr);
5✔
70
  const hostname =
5!
71
    typeof url.hostname === "string" && url.hostname.startsWith("[")
5!
UNCOV
72
      ? url.hostname.slice(1, -1)
×
73
      : url.hostname;
5✔
74
  const options: RequestOptions = {
5✔
75
    agent: false,
5✔
76
    ...baseOptions,
5✔
77
    protocol: url.protocol,
5✔
78
    hostname,
5✔
79
    path: `${url.pathname || ""}${url.search || ""}`,
5!
80
  };
5!
81
  if (url.port !== "") {
5!
82
    options.port = Number(url.port);
×
UNCOV
83
  }
×
84
  if (url.username || url.password) {
5!
85
    options.auth = `${url.username}:${url.password}`;
×
UNCOV
86
  }
×
87

5✔
88
  const PROXY_ENV = [
5✔
89
    "https_proxy",
5✔
90
    "HTTPS_PROXY",
5✔
91
    "http_proxy",
5✔
92
    "HTTP_PROXY",
5✔
93
    "npm_config_https_proxy",
5✔
94
    "npm_config_http_proxy",
5✔
95
  ];
5✔
96

5✔
97
  const proxyStr: string =
5✔
98
    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
5✔
99
    (options as any)?.proxy ||
5✔
100
    // eslint-disable-next-line no-process-env -- ignore
5✔
101
    PROXY_ENV.map((k) => process.env[k]).find((v) => v);
5✔
102
  if (proxyStr) {
5!
103
    const proxyUrl = new URL(proxyStr);
×
UNCOV
104

×
105
    options.agent = tunnel[
×
UNCOV
106
      `http${url.protocol === "https:" ? "s" : ""}OverHttp${
×
UNCOV
107
        proxyUrl.protocol === "https:" ? "s" : ""
×
UNCOV
108
      }`
×
UNCOV
109
    ]({
×
UNCOV
110
      proxy: {
×
UNCOV
111
        host: proxyUrl.hostname,
×
UNCOV
112
        port: Number(proxyUrl.port),
×
UNCOV
113
        proxyAuth:
×
UNCOV
114
          proxyUrl.username || proxyUrl.password
×
UNCOV
115
            ? `${proxyUrl.username}:${proxyUrl.password}`
×
UNCOV
116
            : undefined,
×
UNCOV
117
      },
×
UNCOV
118
    });
×
UNCOV
119
  }
×
120
  return options;
5✔
121
}
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc