function urlIsLocal (url) {
  assert('protocol' in url) // ensure it's a url object

  const protocol = url.protocol

  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
}
Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.