@dotenvx/dotenvx 0.15.2 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.15.2",
2
+ "version": "0.15.4",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -36,7 +36,7 @@
36
36
  "ignore": "^5.3.0",
37
37
  "open": "^8.4.2",
38
38
  "ora": "^5.4.1",
39
- "undici": "^6.6.2",
39
+ "undici": "^5.28.3",
40
40
  "update-notifier": "^5.1.0",
41
41
  "winston": "^3.11.0",
42
42
  "xxhashjs": "^0.2.2"
@@ -78,7 +78,7 @@ async function run () {
78
78
 
79
79
  try {
80
80
  const src = fs.readFileSync(filepath, { encoding: ENCODING })
81
- const parsed = main.parseExpand(src)
81
+ const parsed = main.parseExpand(src, options.overload)
82
82
  const result = main.inject(process.env, parsed, options.overload)
83
83
 
84
84
  readableFilepaths.add(envFilepath)
package/src/lib/main.js CHANGED
@@ -36,11 +36,20 @@ const parse = function (src) {
36
36
  return result
37
37
  }
38
38
 
39
- const parseExpand = function (src) {
39
+ const parseExpand = function (src, overload) {
40
40
  const parsed = dotenv.parse(src)
41
+
42
+ // consider moving this logic straight into dotenv-expand
43
+ let inputParsed = {}
44
+ if (overload) {
45
+ inputParsed = { ...process.env, ...parsed }
46
+ } else {
47
+ inputParsed = { ...parsed, ...process.env }
48
+ }
49
+
41
50
  const expandPlease = {
42
- processEnv: {}, // https://github.com/motdotla/dotenv-expand?tab=readme-ov-file#processenv
43
- parsed: { ...parsed, ...process.env } // must merge process.env in order to use pre-existing envs for expansion of parsed object
51
+ processEnv: {},
52
+ parsed: inputParsed
44
53
  }
45
54
  const expanded = dotenvExpand.expand(expandPlease).parsed
46
55