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

Function getImageCreator

src/tools/FileReadTool/imageProcessor.ts:87–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 * so this always uses sharp directly.
86 */
87export async function getImageCreator(): Promise<SharpCreator> {
88 if (imageCreatorModule) {
89 return imageCreatorModule.default
90 }
91
92 const imported = (await import(
93 'sharp'
94 )) as unknown as MaybeDefault<SharpCreator>
95 const sharp = unwrapDefault(imported)
96 imageCreatorModule = { default: sharp }
97 return sharp
98}
99
100// Dynamic import shape varies by module interop mode — ESM yields { default: fn }, CJS yields fn directly.
101type MaybeDefault<T> = T | { default: T }

Callers 1

packageSmoke.tsFile · 0.85

Calls 1

unwrapDefaultFunction · 0.85

Tested by

no test coverage detected