Skip to content

Commit d35afd1

Browse files
committed
refactor json to .env
1 parent 88b6b64 commit d35afd1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/features/JsonToEnv/JsonToEnv.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const JsonToEnv = () => {
3636
formattedValue = JSON.stringify(value);
3737
}
3838

39-
return `${key}=${formattedValue}`;
39+
// Escape existing double quotes
40+
formattedValue = String(formattedValue).replace(/"/g, '\\"');
41+
42+
return `${key}="${formattedValue}"`;
4043
});
4144

4245
setOutput(envLines.join('\n'));

0 commit comments

Comments
 (0)