MCPcopy Index your code
hub / github.com/tinyplex/tinybase / list

Method list

test/unit/persisters/common/mocks.ts:809–818  ·  view source on GitHub ↗
(options?: {prefix?: string})

Source from the content-addressed store, hash-verified

807 }
808
809 async list<T>(options?: {prefix?: string}): Promise<Map<string, T>> {
810 const result = new Map<string, T>();
811 const prefix = options?.prefix ?? '';
812 for (const [key, value] of this.data.entries()) {
813 if (key.startsWith(prefix)) {
814 result.set(key, value);
815 }
816 }
817 return result;
818 }
819
820 async delete(key: string): Promise<boolean> {
821 return this.data.delete(key);

Callers 1

mocks.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected