MCPcopy
hub / github.com/vitejs/vite / evalValue

Function evalValue

packages/vite/src/node/utils.ts:1676–1682  ·  view source on GitHub ↗
(rawValue: string)

Source from the content-addressed store, hash-verified

1674}
1675
1676export function evalValue<T = any>(rawValue: string): T {
1677 const fn = new Function(`
1678 var console, exports, global, module, process, require
1679 return (\n${rawValue}\n)
1680 `)
1681 return fn()
1682}
1683
1684export function getNpmPackageName(importPath: string): string | null {
1685 const parts = importPath.split('/')

Callers 2

parseGlobOptionsFunction · 0.90
parseWorkerOptionsFunction · 0.90

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected