ac-awssecrets 2.5.0 → 2.5.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.js +18 -8
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+
2
+ ## [2.5.1](https://github.com/admiralcloud/ac-awssecrets/compare/v2.5.0..v2.5.1) (2025-05-13 08:10:25)
3
+
4
+
5
+ ### Bug Fix
6
+
7
+ * **App:** Fixed deep merge with arrays | MP | [715c67bc5ef1c2520069d07953c6f05fd08ab37a](https://github.com/admiralcloud/ac-awssecrets/commit/715c67bc5ef1c2520069d07953c6f05fd08ab37a)
8
+ Fixed deep merge with arrays
9
+ Related issues:
10
+ ### Chores
11
+
12
+ * **App:** Updated packages | MP | [843ab11b885697b471c74d546b40d885cc9f2844](https://github.com/admiralcloud/ac-awssecrets/commit/843ab11b885697b471c74d546b40d885cc9f2844)
13
+ Updated packages
14
+ Related issues:
1
15
 
2
16
  # [2.5.0](https://github.com/admiralcloud/ac-awssecrets/compare/v2.4.4..v2.5.0) (2025-05-06 18:01:30)
3
17
 
package/index.js CHANGED
@@ -32,16 +32,26 @@ const awsSecrets = () => {
32
32
  }
33
33
 
34
34
  const deepMerge = (target, source) => {
35
- const result = { ...target }
36
- for (const key in source) {
37
- if (typeof source[key] === 'object' && !Array.isArray(source[key]) && typeof result[key] === 'object' && !Array.isArray(result[key])) {
38
- result[key] = deepMerge(result[key], source[key])
39
- }
40
- else {
41
- result[key] = source[key]
35
+ if (Array.isArray(target) && Array.isArray(source)) {
36
+ return [...target, ...source]
37
+ }
38
+
39
+ if (typeof source === 'object' && source !== null && typeof target === 'object' && target !== null) {
40
+ const result = { ...target }
41
+
42
+ for (const key in source) {
43
+ if (key in result) {
44
+ result[key] = deepMerge(result[key], source[key])
45
+ }
46
+ else {
47
+ result[key] = source[key]
48
+ }
42
49
  }
50
+
51
+ return result
43
52
  }
44
- return result
53
+
54
+ return source
45
55
  }
46
56
 
47
57
  const setValue = (config, { path, value, array = false, property, merge = false }) => {
package/package.json CHANGED
@@ -3,10 +3,10 @@
3
3
  "author": "Mark Poepping (https://www.admiralcloud.com)",
4
4
  "license": "MIT",
5
5
  "repository": "admiralcloud/ac-awssecrets",
6
- "version": "2.5.0",
6
+ "version": "2.5.1",
7
7
  "dependencies": {
8
- "@aws-sdk/client-secrets-manager": "^3.803.0",
9
- "@aws-sdk/client-ssm": "^3.803.0"
8
+ "@aws-sdk/client-secrets-manager": "^3.808.0",
9
+ "@aws-sdk/client-ssm": "^3.808.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "ac-semantic-release": "^0.4.6",