Skip to content

Commit

Permalink
Hanlde undefined fileString
Browse files Browse the repository at this point in the history
  • Loading branch information
w3cj committed Oct 14, 2024
1 parent 178993c commit 91e2890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/arguments/file-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const safeNormalizeFileUrl = (file, name) => {
const isString = typeof fileString === 'string'
// In Deno node:process execPath is a special object, not just a string:
// https://github.com/denoland/deno/blob/f460188e583f00144000aa0d8ade08218d47c3c1/ext/node/polyfills/process.ts#L344
|| Object.getPrototypeOf(fileString) === String.prototype;
|| (fileString && Object.getPrototypeOf(fileString) === String.prototype);

if (!isString) {
throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);
Expand Down

0 comments on commit 91e2890

Please sign in to comment.