Function
extractNativeSharpFunction
(mod: Record<string, unknown>)
Source from the content-addressed store, hash-verified
| 35 | let imageCreatorModule: { default: SharpCreator } | null = null |
| 36 | |
| 37 | function 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 | |
| 44 | export async function getImageProcessor(): Promise<SharpFunction> { |
| 45 | if (imageProcessorModule) { |
Tested by
no test coverage detected