1import { CurrentSofSource } from "./SiteSource.mjs"; 2 3export class SourceCatalogue 4{ 5 6 #held = new Map(); 7 8 Key(source) 9 { 10 return String(source?.id ?? ""); 11 } 12 13 async Fetch() 14 { 15 return []; 16 } 17 18 List() 19 { 20 const source = CurrentSofSource(); 21 const key = this.Key(source); 22 const held = this.#held.get(key); 23 24 if (held) return held; 25 26 const pending = this.Fetch(source).catch(() => []); 27 28 this.#held.set(key, pending); 29 30 pending.then(list => { if (!list.length) this.#held.delete(key); }); 31 32 return pending; 33 } 34 35 Forget() 36 { 37 this.#held.clear(); 38 } 39 40} 41 42export default SourceCatalogue;
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.