MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / memoryStorage

Function memoryStorage

apps/kimi-web/test/input-history.test.ts:145–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143});
144
145function memoryStorage(): Storage {
146 const map = new Map<string, string>();
147 return {
148 get length() {
149 return map.size;
150 },
151 clear: () => {
152 map.clear();
153 },
154 getItem: (key: string) => map.get(key) ?? null,
155 key: (index: number) => Array.from(map.keys())[index] ?? null,
156 removeItem: (key: string) => {
157 map.delete(key);
158 },
159 setItem: (key: string, value: string) => {
160 map.set(key, value);
161 },
162 };
163}
164
165describe('useInputHistory — persistence', () => {
166 let original: Storage | undefined;

Callers 1

Calls 5

keysMethod · 0.80
clearMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected