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

Function storeWith

apps/kimi-code/test/tui/input/image-placeholder.test.ts:12–20  ·  view source on GitHub ↗
(
  bytes: Uint8Array,
  width = 640,
  height = 480,
)

Source from the content-addressed store, hash-verified

10import { getCacheDir } from '#/utils/paths';
11
12function storeWith(
13 bytes: Uint8Array,
14 width = 640,
15 height = 480,
16): { store: ImageAttachmentStore; placeholder: string } {
17 const store = new ImageAttachmentStore();
18 const att = store.addImage(bytes, 'image/png', width, height);
19 return { store, placeholder: att.placeholder };
20}
21
22/** Point `getCacheDir()` at a fresh temp home for the duration of a test. */
23function setupTempCache(): { cleanup: () => void } {

Callers 1

Calls 1

addImageMethod · 0.95

Tested by

no test coverage detected