Fix linting.
This commit is contained in:
parent
04b9e76b70
commit
c047759558
@ -13,9 +13,11 @@ import { readFile } from "fs/promises";
|
|||||||
if (globalThis.fetch) {
|
if (globalThis.fetch) {
|
||||||
const originalFetch = globalThis.fetch;
|
const originalFetch = globalThis.fetch;
|
||||||
globalThis.fetch = async function patchedFetch(url, options) {
|
globalThis.fetch = async function patchedFetch(url, options) {
|
||||||
const urlStr = typeof url === "string" ? url
|
const urlStr = typeof url === "string" ?
|
||||||
: url instanceof URL ? url.href
|
url :
|
||||||
: String(url);
|
url instanceof URL ?
|
||||||
|
url.href :
|
||||||
|
String(url);
|
||||||
// Intercept bare filesystem paths (absolute POSIX or Windows)
|
// Intercept bare filesystem paths (absolute POSIX or Windows)
|
||||||
if (urlStr.startsWith("/") || /^[A-Za-z]:[/\\]/.test(urlStr)) {
|
if (urlStr.startsWith("/") || /^[A-Za-z]:[/\\]/.test(urlStr)) {
|
||||||
const buffer = await readFile(urlStr);
|
const buffer = await readFile(urlStr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user