refactor(storage): extract helpers + verifyPublicAccess from r2Service (8/10)

File-size decomposition (no behavior change). Move the pure helpers
(normalizeInfoHash, isValidInfoHash, resolveUploadIdentifier, buildCorsGuidance,
createDefaultSettings, safeDecodeNpub) and the verifyPublicAccess flow (as an
instance-param function with a thin delegator) into js/services/r2ServiceHelpers.js.
Dropped the now-unused calculateTorrentInfoHash import from the service.

r2Service.js: 1376 -> 1192 lines (below its original 1194 baseline; re-recorded
to 1192).

Build + full unit suite green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Opus 4.8 committed 2026-06-19 16:35:53 -04:00
1 parent c562a326ae
commit 573c9b00ef
3 files changed
+220 -194

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ const GRANDFATHERED = {
"js/services/playbackService.js": 1274,
"js/services/authService.js": 1335,
"js/ui/zapController.js": 1206,
"js/services/r2Service.js": 1194,
"js/services/r2Service.js": 1192,
"js/ui/applicationBootstrap.js": 1163,
"js/ui/components/EditModal.js": 1130,
"js/services/commentThreadService.js": 1100,