MCPcopy Create free account
hub / github.com/openai/codex-plugin-cc / isProbablyText

Function isProbablyText

plugins/codex/scripts/lib/fs.mjs:25–33  ·  view source on GitHub ↗
(buffer)

Source from the content-addressed store, hash-verified

23}
24
25export function isProbablyText(buffer) {
26 const sample = buffer.subarray(0, Math.min(buffer.length, 4096));
27 for (const value of sample) {
28 if (value === 0) {
29 return false;
30 }
31 }
32 return true;
33}
34
35export function readStdinIfPiped() {
36 if (process.stdin.isTTY) {

Callers 1

formatUntrackedFileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected