(value: string)
| 56 | // Env file parsing |
| 57 | // --------------------------------------------------------------------------- |
| 58 | |
| 59 | function stripEnvQuotes(value: string): string { |
| 60 | if (value.startsWith('"') && value.endsWith('"')) { |
| 61 | return value |
| 62 | .slice(1, -1) |
| 63 | .replace(/\\(["\\n])/g, (_match, ch: string) => (ch === 'n' ? '\n' : ch)); |
| 64 | } |
| 65 | if (value.startsWith("'") && value.endsWith("'")) { |
| 66 | return value.slice(1, -1); |
| 67 | } |
| 68 | // An unquoted value follows dotenv semantics, which nextjs applies when it |
| 69 | // reads the same .env.local: a trailing ` # comment` is not part of the |
| 70 | // value (the e2e stub tags its env line with one). |
| 71 | return value.replace(/\s+#.*$/, '').trim(); |
no test coverage detected