MCPcopy Create free account
hub / github.com/modem-dev/hunk / onData

Function onData

src/core/themeDetection.ts:109–115  ·  view source on GitHub ↗
(chunk: Buffer | string)

Source from the content-addressed store, hash-verified

107
108 const timer = setTimeout(() => finish(null), timeoutMs);
109 const onData = (chunk: Buffer | string) => {
110 buffer += Buffer.isBuffer(chunk) ? chunk.toString("utf8") : chunk;
111 const color = parseOsc11BackgroundColor(buffer);
112 if (color) {
113 finish(themeModeForBackgroundColor(color));
114 }
115 };
116
117 input.setRawMode?.(true);
118 input.resume?.();

Callers

nothing calls this directly

Calls 3

finishFunction · 0.70

Tested by

no test coverage detected