@dotenvx/dotenvx 2.24.0 → 2.24.1

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/v2.24.0...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.24.1...main)
6
+
7
+ ## [2.24.1](https://github.com/dotenvx/dotenvx/compare/v2.24.0...v2.24.1) (2026-09-11)
8
+
9
+ ### Changed
10
+
11
+ * Upgraded to latest [@dotenvx/primitives](https://www.npmjs.com/package/@dotenvx/primitives)
6
12
 
7
13
  ## [2.24.0](https://github.com/dotenvx/dotenvx/compare/v2.23.0...v2.24.0) (2026-09-10)
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.24.0",
2
+ "version": "2.24.1",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "funding": "https://dotenvx.com",
55
55
  "dependencies": {
56
- "@dotenvx/primitives": "^2.2.0",
56
+ "@dotenvx/primitives": "^3.0.2",
57
57
  "@dotenvx/tooling": "^1.0.3",
58
58
  "yocto-spinner": "^1.2.1"
59
59
  },
@@ -1,4 +1,4 @@
1
- const { parse, parseSync } = require('@dotenvx/primitives')
1
+ const { parse, parseSync, parsearrays } = require('@dotenvx/primitives')
2
2
  const SERVER_SIDE_DECRYPTION_REQUIRED = 'SERVER_SIDE_DECRYPTION_REQUIRED'
3
3
 
4
4
  function decryptOptions (error) {
@@ -27,21 +27,29 @@ function failedKeyAccessFallback (result, error) {
27
27
  }
28
28
 
29
29
  async function parseWithDecryptor (src, options = {}) {
30
+ return parseWith(src, options, parse)
31
+ }
32
+
33
+ parseWithDecryptor.arrays = async function parsearraysWithDecryptor (src, options = {}) {
34
+ return parseWith(src, options, parsearrays)
35
+ }
36
+
37
+ async function parseWith (src, options, parser) {
30
38
  try {
31
- return await parse(src, options)
39
+ return await parser(src, options)
32
40
  } catch (error) {
33
41
  if (error.code !== SERVER_SIDE_DECRYPTION_REQUIRED || typeof options.decryptor !== 'function') {
34
42
  if (typeof options.provider !== 'function') throw error
35
43
 
36
- const result = await parse(src, parseOptionsWithoutProvider(options))
44
+ const result = await parser(src, parseOptionsWithoutProvider(options))
37
45
  return failedKeyAccessFallback(result, error)
38
46
  }
39
47
 
40
48
  try {
41
49
  const result = await options.decryptor(src, decryptOptions(error))
42
- return await parse(result.src, parseOptionsWithoutProvider(options))
50
+ return await parser(result.src, parseOptionsWithoutProvider(options))
43
51
  } catch (decryptorError) {
44
- const result = await parse(src, parseOptionsWithoutProvider(options))
52
+ const result = await parser(src, parseOptionsWithoutProvider(options))
45
53
  return failedKeyAccessFallback(result, decryptorError)
46
54
  }
47
55
  }
@@ -44,7 +44,7 @@ async function decrypt (options = {}) {
44
44
  const encoding = await detectEncoding(filepath)
45
45
  row.envSrc = await fsx.readFileX(filepath, { encoding })
46
46
 
47
- const { parsed, errors } = await parseWithDecryptor(row.envSrc, { fk, ik, ek, array: true, provider, decryptor })
47
+ const { parsed, errors } = await parseWithDecryptor.arrays(row.envSrc, { fk, ik, ek, provider, decryptor })
48
48
 
49
49
  if (errors.length > 0) {
50
50
  row.error = parseError(errors[0])