MCPcopy Index your code
hub / github.com/simstudioai/sim / isBinaryBuffer

Function isBinaryBuffer

apps/sim/connectors/gitlab/gitlab.ts:66–72  ·  view source on GitHub ↗

* Heuristic binary detection: a NUL byte in the first 8 KB marks the file as * binary, matching `git diff` / `git grep` semantics.

(buf: Buffer)

Source from the content-addressed store, hash-verified

64 * binary, matching `git diff` / `git grep` semantics.
65 */
66function isBinaryBuffer(buf: Buffer): boolean {
67 const len = Math.min(buf.length, BINARY_SNIFF_BYTES)
68 for (let i = 0; i < len; i++) {
69 if (buf[i] === 0) return true
70 }
71 return false
72}
73
74/**
75 * Parses a comma-separated extension filter into a normalized set (leading dot,

Callers 1

fileToDocumentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected