1 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Opus 4.8 370cc67cc5 refactor(webtorrent): extract pure + SW-controller helpers (9/10)
File-size decomposition of the playback-critical module (no behavior change).
Move the pure helpers (compareServiceWorkerScripts, normalizeTrackerList,
appendProbeTrackers, normalizeNumber, toError) and the service-worker
controller-claim pair (requestClientsClaim, waitForActiveController, as
instance-param functions with thin delegators) into js/webtorrentHelpers.js.
Dropped the now-unused safeDecodeURIComponent import from webtorrent.js.

webtorrent.js: 1256 -> 1043 lines (back under its 1087 limit).

All moved functions were module-private (no public-export/test-import changes).
Build + full unit suite green (incl. WebTorrent regression/handlers/minimal
tests).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-19 16:39:38 -04:00