Skip to content

Commit

Permalink
types(fileURLToPath): accept url as input
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 11, 2024
1 parent b853ca4 commit 34f6026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -2,7 +2,7 @@ import { fileURLToPath as _fileURLToPath } from "node:url";
import { promises as fsp } from "node:fs";
import { normalizeSlash, BUILTIN_MODULES } from "./_utils";

export function fileURLToPath(id: string): string {
export function fileURLToPath(id: string | URL): string {
if (typeof id === "string" && !id.startsWith("file://")) {
return normalizeSlash(id);
}
Expand Down

0 comments on commit 34f6026

Please sign in to comment.