export function isLocalDevPluginSourceUrl(url: string): boolean {
  try {
    const parsed = new URL(url);

    return parsed.protocol === 'http:'
      && (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1');
  } catch {
    return false;
  }
}

export function isSecurePluginRemoteUrl(url: string): boolean {
  return url.startsWith('https://') || isLocalDevPluginSourceUrl(url);
}
