Skip to content

Commit

Permalink
Core: Fix double stringification of process.env
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Nov 19, 2021
1 parent b422c7f commit 590a5d1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/core-common/src/utils/envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ export function loadEnvs(
};
}

export const stringifyEnvs = (raw: Record<string, string>): Record<string, string> =>
Object.entries(raw).reduce<Record<string, string>>((acc, [key, value]) => {
acc[key] = JSON.stringify(value);
return acc;
}, {});

export const stringifyProcessEnvs = (raw: Record<string, string>): Record<string, string> => {
const envs = Object.entries(raw).reduce<Record<string, string>>(
(acc, [key, value]) => {
Expand All @@ -61,6 +55,6 @@ export const stringifyProcessEnvs = (raw: Record<string, string>): Record<string
);
// support destructuring like
// const { foo } = process.env;
envs['process.env'] = JSON.stringify(stringifyEnvs(raw));
envs['process.env'] = JSON.stringify(raw);
return envs;
};

0 comments on commit 590a5d1

Please sign in to comment.