// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

export function assertArg(url: URL | string) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol !== "file:") {
    throw new TypeError("Must be a file URL.");
  }
  return url;
}

// denoCacheMetadata={"headers":{"cf-cache-status":"HIT","accept-ranges":"bytes","etag":"\"6dd159b98014ce06ab6e55b00551424e\"","x-jsr-backend":"modules","set-cookie":"__cf_bm=yR4LMjV0AVD9URcdTUTtOslEWC7sE6s2xsiAhwA2TQQ-1785241875.2939079-1.0.1.1-Uonk1FQW_uhMtsBSRulCRku0V_sDFgW2XtzJ2fkmz9JvPafGYkEXhtwGGf2G6dPBsVFo6XP80zbhzbTrOucKW5UC8ujifgxcLK3z7viHZhIhRCwfB3sI156IF.l.3VkK; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","age":"3899562","content-type":"text/typescript","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","access-control-allow-origin":"*","server":"cloudflare","content-length":"312","cache-control":"public, max-age=31536000, immutable","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","access-control-expose-headers":"*","cross-origin-resource-policy":"cross-origin","x-content-type-options":"nosniff","x-robots-tag":"noindex","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=CoTqQUR5nnFkSu1%2FeWRHKPb6Fb6LzY%2BMgiEgXwmu%2FSgWGDTLuEeHmctZXCQnZVZPYNNMpUjRNyO941LJR%2BFX3zPbt8mGV8AyTl8Rs8qy%2F92KSvbytwisEkA%3D\"}]}","date":"Tue, 28 Jul 2026 12:31:15 GMT","alt-svc":"h3=\":443\"; ma=86400","vary":"Origin","cf-ray":"a223e6589cc47db6-LAX"},"url":"https://jsr.io/@std/path/0.224.0/_common/from_file_url.ts","time":1785241875}