MCPcopy Create free account
hub / github.com/arktypeio/arktype / isolate

Function isolate

ark/docs/components/playground/execute.ts:32–33  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

30
31/** the editor's code as a function body, arktype's exports being globals */
32export const isolate = (code: string): string =>
33 code.replace(importDeclaration, "").replace(/^\s*export\s+const/gm, "const")
34
35/** runs isolated code, returning the values of the names it declares */
36export const evaluate = (

Callers 3

writePrecompiledFunction · 0.90
executeCodeFunction · 0.70
precompile.test.tsFile · 0.50

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected