1const STORAGE_KEY = "hackorum:visited-topics" 2const LIMIT = 50 3 4export function all() { 5 try { 6 const raw = window.sessionStorage.getItem(STORAGE_KEY) 7 if (!raw) return [] 8 const parsed = JSON.parse(raw) 9 return Array.isArray(parsed) ? parsed.filter(id => Number.isInteger(id)) : [] 10 } catch (e) { 11 console.warn("visited topics read failed", e) 12 return [] 13 } 14} 15 16export function remember(id) { 17 if (!Number.isInteger(id) || id <= 0) return 18 19 try { 20 const kept = all().filter(existing => existing !== id) 21 kept.push(id) 22 window.sessionStorage.setItem(STORAGE_KEY, JSON.stringify(kept.slice(-LIMIT))) 23 } catch (e) { 24 console.warn("visited topics write failed", e) 25 } 26}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.