MCPcopy Create free account
hub / github.com/Noumena-Network/code / extractNativeSharpFunction

Function extractNativeSharpFunction

src/tools/FileReadTool/imageProcessor.ts:37–42  ·  view source on GitHub ↗
(mod: Record<string, unknown>)

Source from the content-addressed store, hash-verified

35let imageCreatorModule: { default: SharpCreator } | null = null
36
37function extractNativeSharpFunction(mod: Record<string, unknown>): SharpFunction | null {
38 const candidate = mod.sharp ?? mod.default
39 return typeof candidate === 'function'
40 ? (candidate as SharpFunction)
41 : null
42}
43
44export async function getImageProcessor(): Promise<SharpFunction> {
45 if (imageProcessorModule) {

Callers 1

getImageProcessorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected