@dotenvx/dotenvx 1.24.4 → 1.24.5

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/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.24.4...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.24.5...main)
6
+
7
+ ## [1.24.5](https://github.com/dotenvx/dotenvx/compare/v1.24.4...v1.24.5)
8
+
9
+ ### Changed
10
+
11
+ * 🐞 do not expand prior literal values ([#458](https://github.com/dotenvx/dotenvx/pull/458))
6
12
 
7
13
  ## [1.24.4](https://github.com/dotenvx/dotenvx/compare/v1.24.3...v1.24.4)
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.24.4",
2
+ "version": "1.24.5",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -20,6 +20,8 @@ class Parse {
20
20
 
21
21
  // for use with progressive expansion
22
22
  this.runningParsed = {}
23
+ // for use with stopping expansion for literals
24
+ this.literals = {}
23
25
  }
24
26
 
25
27
  run () {
@@ -58,6 +60,10 @@ class Parse {
58
60
  this.parsed[key] = resolveEscapeSequences(this.expand(this.parsed[key]))
59
61
  }
60
62
 
63
+ if (quote === "'") {
64
+ this.literals[key] = this.parsed[key]
65
+ }
66
+
61
67
  // for use with progressive expansion
62
68
  this.runningParsed[key] = this.parsed[key]
63
69
 
@@ -162,7 +168,6 @@ class Parse {
162
168
 
163
169
  let defaultValue
164
170
  let value
165
-
166
171
  const key = r.shift()
167
172
 
168
173
  if ([':+', '+'].includes(splitter)) {
@@ -184,6 +189,11 @@ class Parse {
184
189
  break
185
190
  }
186
191
 
192
+ // if the result came from what was a literal value then stop expanding
193
+ if (this.literals[key]) {
194
+ break
195
+ }
196
+
187
197
  regex.lastIndex = 0 // reset regex search position to re-evaluate after each replacement
188
198
  }
189
199