Fix linting.

This commit is contained in:
Leon Zandman 2026-03-20 20:04:19 +01:00 committed by GCHQDeveloper581
parent e2c326ad54
commit 899583b0ad
No known key found for this signature in database
GPG Key ID: 6222E059A3DF595C

View File

@ -13,9 +13,11 @@ import { readFile } from "fs/promises";
if (globalThis.fetch) {
const originalFetch = globalThis.fetch;
globalThis.fetch = async function patchedFetch(url, options) {
const urlStr = typeof url === "string" ? url
: url instanceof URL ? url.href
: String(url);
const urlStr = typeof url === "string" ?
url :
url instanceof URL ?
url.href :
String(url);
// Intercept bare filesystem paths (absolute POSIX or Windows)
if (urlStr.startsWith("/") || /^[A-Za-z]:[/\\]/.test(urlStr)) {
const buffer = await readFile(urlStr);