a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore(car): explain mst

Mary 9a4ac027 e7562c71

+2
+2
packages/utilities/car/lib/atproto-repo.ts
··· 15 15 const { roots, iterate } = fromUint8Array(new Uint8Array(buf)); 16 16 assert(roots.length === 1, `expected only 1 root in the car archive; got=${roots.length}`); 17 17 18 + // Collect all archive entries into a mapping of CID string -> actual bytes 18 19 const blockmap: BlockMap = new Map(); 19 20 for (const entry of iterate()) { 20 21 blockmap.set(CID.format(entry.cid), entry.bytes); 21 22 } 22 23 24 + // Read the head, then walk through the MST tree from there. 23 25 const commit = readObject(blockmap, roots[0]) as Commit; 24 26 for (const { key, cid } of walkEntries(blockmap, commit.data)) { 25 27 const [collection, rkey] = key.split('/');