Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { asksFirst, choice, consentRequired } from "./analytics-consent.ts"; | |
| 5 | ||
| 6 | test("visitors from the EU, EEA, UK and Switzerland are asked first", () => { | |
| 7 | for (const country of ["DE", "fr", "IE", "NO", "IS", "GB", "CH"]) assert.equal(asksFirst(country), true, country); | |
| 8 | }); | |
| 9 | ||
| 10 | test("others are not, nor is a visitor whose country is unknown", () => { | |
| 11 | for (const country of ["US", "CA", "AU", "JP", "BR"]) assert.equal(asksFirst(country), false, country); | |
| 12 | assert.equal(asksFirst(null), false); | |
| 13 | assert.equal(asksFirst(""), false); | |
| 14 | }); | |
| 15 | ||
| 16 | test("on the server nothing is chosen or required", () => { | |
| 17 | assert.equal(choice(), null); | |
| 18 | assert.equal(consentRequired(), false); | |
| 19 | }); |
This file's history is long; its oldest lines are credited to the oldest commit read.