Function
defineReplaceEnv
(
key: TKey,
value: TValue,
)
Source from the content-addressed store, hash-verified
| 446 | } |
| 447 | |
| 448 | function defineReplaceEnv<TKey extends string, TValue extends string>( |
| 449 | key: TKey, |
| 450 | value: TValue, |
| 451 | ): { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } { |
| 452 | return { |
| 453 | [`process.env.${key}`]: JSON.stringify(value), |
| 454 | [`import.meta.env.${key}`]: JSON.stringify(value), |
| 455 | } as { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } |
| 456 | } |
Tested by
no test coverage detected