()
| 112 | ] as const; |
| 113 | |
| 114 | function createSubprocessEnv(): Record<string, string> { |
| 115 | const env = Object.fromEntries( |
| 116 | Object.entries(process.env).filter((entry): entry is [string, string] => { |
| 117 | return typeof entry[1] === 'string'; |
| 118 | }), |
| 119 | ); |
| 120 | |
| 121 | delete env.NPM_CONFIG_BEFORE; |
| 122 | delete env.npm_config_before; |
| 123 | |
| 124 | for (const key of SUBPROCESS_ENV_EXCLUSIONS) { |
| 125 | delete env[key]; |
| 126 | } |
| 127 | |
| 128 | return env; |
| 129 | } |
| 130 | |
| 131 | function createScanEnv(oidcToken: string | undefined): Record<string, string> { |
| 132 | const env = createSubprocessEnv(); |
no outgoing calls
no test coverage detected
searching dependent graphs…