function fromFileUrl(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol != "file:") {
    throw new TypeError("Must be a file URL.");
  }
  return decodeURIComponent(
    url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"),
  );
}
/**
 * Converts a file URL to a path string.
 *
 *      fromFileUrl("file:///home/foo"); // "/home/foo"
 * @param url of a file URL
 */
Converts a file URL to a path string.
Converts a file URL to a path string .
function fromFileUrl(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol != "file:") {
    throw new TypeError("Must be a file URL.");
  }
  return decodeURIComponent(
    url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"),
  );
}
function fromFileUrl ( url ) { url = url instanceof URL ? url : new URL ( url ) ; if ( url . protocol != "file:" ) { throw new TypeError ( "Must be a file URL." ) ; } return decodeURIComponent ( url . pathname . replace ( / %(?![0-9A-Fa-f]{2}) / g , "%25" ) , ) ; }
Converts a file URL to a path string.
Converts a file URL to a path string .