MCPcopy
hub / github.com/tinyplex/tinybase / get

Method get

test/unit/persisters/common/mocks.ts:789–801  ·  view source on GitHub ↗
(
    keyOrKeys: string | string[],
  )

Source from the content-addressed store, hash-verified

787 async get<T>(key: string): Promise<T | undefined>;
788 async get<T>(keys: string[]): Promise<Map<string, T>>;
789 async get<T>(
790 keyOrKeys: string | string[],
791 ): Promise<T | undefined | Map<string, T>> {
792 if (Array.isArray(keyOrKeys)) {
793 const result = new Map<string, T>();
794 for (const key of keyOrKeys) {
795 const value = this.data.get(key);
796 if (value !== undefined) result.set(key, value);
797 }
798 return result;
799 }
800 return this.data.get(keyOrKeys);
801 }
802
803 async put(entries: Record<string, any>): Promise<void> {
804 for (const [key, value] of Object.entries(entries)) {

Callers 15

fileRewriteFunction · 0.80
persisters.test.tsFile · 0.80
createMockStorageFunction · 0.80
mergeable.test.tsFile · 0.80
getRowRecordFunction · 0.80
yMapMatchFunction · 0.80
mocks.tsFile · 0.80
getFragmentGroupFunction · 0.80
expectDocShotFunction · 0.80
getYContentFunction · 0.80

Calls

no outgoing calls

Tested by 4

createMockStorageFunction · 0.64
getRowRecordFunction · 0.64
getFragmentGroupFunction · 0.64
expectDocShotFunction · 0.64