function stage25Widget(url) { const u = new URL(url); if (u.origin !== 'https://example.org' || u.pathname !== '/donate' || u.search || u.hash || u.username || u.password) throw Error('Unapproved destination'); return u.href; } if (typeof module !== 'undefined') { const assert = require('node:assert/strict'); assert.equal(stage25Widget('https://example.org/donate'), 'https://example.org/donate'); assert.throws(() => stage25Widget('https://example.org.evil.test/donate')); }