Skip to main content

compileFunction

function compileFunction
Jump to headingcompileFunction(
code: string,
params?: readonly string[],
): Function & { cachedData?: Script["cachedData"] | undefined; cachedDataProduced?: Script["cachedDataProduced"] | undefined; cachedDataRejected?: Script["cachedDataRejected"] | undefined; }

Compiles the given code into the provided context (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given params.

Parameters Jump to heading

Jump to headingcode: string

The body of the function to compile.

optional
Jump to headingparams: readonly string[]

An array of strings containing all parameters for the function.

Return Type Jump to heading

Function & { cachedData?: Script["cachedData"] | undefined; cachedDataProduced?: Script["cachedDataProduced"] | undefined; cachedDataRejected?: Script["cachedDataRejected"] | undefined; }
Back to top