MCPcopy
hub / github.com/prisma/prisma / restoreEnv

Function restoreEnv

packages/cli/src/__tests__/commands/DebugInfo.test.ts:15–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13const originalEnv = { ...process.env }
14
15function restoreEnv() {
16 for (const key of Object.keys(process.env)) {
17 if (!(key in originalEnv)) {
18 delete process.env[key]
19 }
20 }
21
22 for (const [key, value] of Object.entries(originalEnv)) {
23 if (value === undefined) {
24 delete process.env[key]
25 } else {
26 process.env[key] = value
27 }
28 }
29}
30
31function cleanSnapshot(str: string): string {
32 str = str.replace(new RegExp('(Path: ).*', 'g'), '$1REDACTED_PATH')

Callers 1

DebugInfo.test.tsFile · 0.70

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected