MCPcopy
hub / github.com/qq15725/modern-screenshot / orCreateContext

Function orCreateContext

src/create-context.ts:17–19  ·  view source on GitHub ↗
(node: any, options?: Options)

Source from the content-addressed store, hash-verified

15export async function orCreateContext<T extends Node>(context: Context<T>): Promise<Context<T>>
16export async function orCreateContext<T extends Node>(node: T, options?: Options): Promise<Context<T>>
17export async function orCreateContext(node: any, options?: Options): Promise<Context> {
18 return isContext(node) ? node : createContext(node, { ...options, autoDestruct: true })
19}
20
21export async function createContext<T extends Node>(node: T, options?: Options & { autoDestruct?: boolean }): Promise<Context<T>> {
22 const { scale = 1, workerUrl, workerNumber = 1 } = options || {}

Callers 10

domToWebpFunction · 0.90
domToPngFunction · 0.90
domToDataUrlFunction · 0.90
domToForeignObjectSvgFunction · 0.90
domToCanvasFunction · 0.90
domToJpegFunction · 0.90
domToSvgFunction · 0.90
domToPixelFunction · 0.90
domToImageFunction · 0.90
domToBlobFunction · 0.90

Calls 2

isContextFunction · 0.90
createContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…