MCPcopy Create free account
hub / github.com/cloudflare/agents / getEncoding

Function getEncoding

packages/shell/src/fs/encoding.ts:82–92  ·  view source on GitHub ↗
(
  options?: ReadFileOptions | WriteFileOptions | BufferEncoding | string | null
)

Source from the content-addressed store, hash-verified

80}
81
82export function getEncoding(
83 options?: ReadFileOptions | WriteFileOptions | BufferEncoding | string | null
84): BufferEncoding | undefined {
85 if (options === null || options === undefined) {
86 return undefined;
87 }
88 if (typeof options === "string") {
89 return options as BufferEncoding;
90 }
91 return options.encoding ?? undefined;
92}

Callers 4

constructorMethod · 0.90
writeFileSyncMethod · 0.90
readFileMethod · 0.90
writeFileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected