MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / bufferKind

Function bufferKind

quote/quote.ts:887–895  ·  view source on GitHub ↗
(buffer: Buffer | undefined)

Source from the content-addressed store, hash-verified

885}
886
887async function waitForStableFile(filePath: string, timeoutMs = 8000): Promise<Buffer | undefined> {
888 const start = Date.now();
889 let lastSize = -1;
890 let stable = 0;
891 while (Date.now() - start < timeoutMs) {
892 try {
893 if (fs.existsSync(filePath)) {
894 const size = fs.statSync(filePath).size;
895 if (size > 0 && size === lastSize) {
896 stable += 1;
897 if (stable >= 2) return fs.readFileSync(filePath);
898 } else {

Callers 2

Calls 2

isGifBufferFunction · 0.85
isWebmBufferFunction · 0.85

Tested by

no test coverage detected