( env: Record<string, string>, output: Record<string, unknown>, )
| 122 | } |
| 123 | |
| 124 | function buildScriptGlobals( |
| 125 | env: Record<string, string>, |
| 126 | output: Record<string, unknown>, |
| 127 | ): vm.Context { |
| 128 | return { |
| 129 | ...env, |
| 130 | output, |
| 131 | json: parseRunScriptJson, |
| 132 | http: { |
| 133 | post: (url: string, options?: { headers?: Record<string, string>; body?: string }) => |
| 134 | runHttpRequestSync('POST', url, options), |
| 135 | }, |
| 136 | }; |
| 137 | } |
| 138 | |
| 139 | function parseRunScriptJson(value: unknown): unknown { |
| 140 | if (typeof value !== 'string') { |
no test coverage detected
searching dependent graphs…