import { fileURLToPath } from 'node:url'; export function assertPublishBranch(environment) { if (environment.CF_PAGES !== '1') return; if (environment.CF_PAGES_BRANCH === 'main') return; throw new Error('Private draft protection: Cloudflare may only build main. Draft branches must not produce public previews.'); } if (process.argv[1] === fileURLToPath(import.meta.url)) assertPublishBranch(process.env);