MCPcopy
hub / github.com/Doorman11991/smallcode / formatList

Method formatList

bin/memory.js:179–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177
178 // Format for display
179 formatList() {
180 const objects = this.all();
181 if (objects.length === 0) return ' (no memory objects)';
182
183 const byType = {};
184 for (const obj of objects) {
185 if (!byType[obj.type]) byType[obj.type] = [];
186 byType[obj.type].push(obj);
187 }
188
189 let output = '';
190 for (const [type, objs] of Object.entries(byType)) {
191 output += ` ${type} (${objs.length}):\n`;
192 for (const obj of objs) {
193 output += ` [${obj.id}] ${obj.title}\n`;
194 }
195 }
196 return output;
197 }
198
199 // Get stats
200 stats() {

Callers

nothing calls this directly

Calls 1

allMethod · 0.95

Tested by

no test coverage detected