(rawValue: string)
| 8 | * @internal |
| 9 | */ |
| 10 | export function evalValue<T = unknown>(rawValue: string): T { |
| 11 | const fn = new Function(` |
| 12 | var console, exports, global, module, process, require |
| 13 | return (\n${rawValue}\n) |
| 14 | `); |
| 15 | return fn(); |
| 16 | } |
| 17 | |
| 18 | // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/shared/utils.ts#L31-L34 |
| 19 | const postfixRE = /[?#].*$/; |