let result: boolean | undefined; export function supportsPrefetch() { if (result === undefined) { const link = document.createElement('link'); result = !!link.relList?.supports?.('prefetch'); } return result; }