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

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

22 Jan 2026 12:05PM UTC coverage: 89.615% (-0.003%) from 89.618%
21247766648

Pull #464

github

web-flow
Merge b3c4800e9 into 0ec9cee70
Pull Request #464: fix: update createRequire to use import.meta.url for module loading

581 of 677 branches covered (85.82%)

Branch coverage included in aggregate %.

2 of 3 new or added lines in 2 files covered. (66.67%)

2517 of 2780 relevant lines covered (90.54%)

237.11 hits per line

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

63.64
/src/utils/http-client/http.ts
1
import type { RequestOptions } from "https";
1✔
2
import defaultClient from "./get-modules/http.ts";
1✔
3
import { createRequire } from "module";
1✔
4
import { isAbsolute } from "path";
1✔
5
import { pathToFileURL } from "url";
1✔
6

1✔
7
/**
1✔
8
 * GET Method
1✔
9
 */
1✔
10
export async function get(
19✔
11
  url: string,
3✔
12
  options?: RequestOptions,
3✔
13
  httpModulePath?: string,
3✔
14
): Promise<string> {
3✔
15
  const client = httpModulePath
3!
16
    ? await loadModule(httpModulePath)
✔
17
    : defaultClient;
3✔
18
  return client.default ? client.default(url, options) : client(url, options);
3!
19
}
3✔
20

1✔
21
/**
1✔
22
 * Load module by path
1✔
23
 */
1✔
24
async function loadModule(modulePath: string) {
×
25
  const adjustedPath =
×
26
    !modulePath.startsWith("file://") && isAbsolute(modulePath)
×
27
      ? pathToFileURL(modulePath).href
×
28
      : modulePath;
×
29
  try {
×
NEW
30
    const require = createRequire(import.meta.url);
×
31
    return require(adjustedPath);
×
32
  } catch {
×
33
    return await import(adjustedPath);
×
34
  }
×
35
}
×
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