asherah 4.0.14 → 4.0.16

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 (2) hide show
  1. package/npm/index.js +16 -9
  2. package/package.json +9 -9
package/npm/index.js CHANGED
@@ -139,21 +139,28 @@ const KMS_ALIASES = {
139
139
  };
140
140
 
141
141
  function normalizeConfig(config) {
142
- // Detect PascalCase format by checking for ServiceName (capital S)
143
- if (!config || typeof config !== 'object' || !('ServiceName' in config)) {
142
+ if (!config || typeof config !== 'object') {
144
143
  return config;
145
144
  }
146
145
 
146
+ // Detect PascalCase format by checking for ServiceName (capital S)
147
+ const isPascal = 'ServiceName' in config;
147
148
  const out = {};
148
149
  for (const [key, value] of Object.entries(config)) {
149
- const mapped = CONFIG_MAP[key];
150
- if (mapped === undefined) {
151
- // Unknown field — pass through as-is (may be a camelCase field mixed in)
152
- out[key] = value;
153
- } else if (mapped !== null) {
154
- out[mapped] = value;
150
+ if (isPascal) {
151
+ const mapped = CONFIG_MAP[key];
152
+ if (mapped === undefined) {
153
+ // Unknown field — pass through as-is (may be a camelCase field mixed in)
154
+ if (value != null) out[key] = value;
155
+ } else if (mapped !== null) {
156
+ if (value != null) out[mapped] = value;
157
+ }
158
+ // mapped === null means ignored (Go-specific)
159
+ } else {
160
+ // camelCase input — strip null/undefined values so napi-rs sees
161
+ // undefined (maps to Option::None) instead of null (type error)
162
+ if (value != null) out[key] = value;
155
163
  }
156
- // mapped === null means ignored (Go-specific)
157
164
  }
158
165
 
159
166
  // Normalize metastore aliases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asherah",
3
- "version": "4.0.14",
3
+ "version": "4.0.16",
4
4
  "private": false,
5
5
  "description": "Asherah envelope encryption and key rotation library",
6
6
  "main": "npm/index.js",
@@ -37,13 +37,13 @@
37
37
  "node": ">= 18"
38
38
  },
39
39
  "optionalDependencies": {
40
- "asherah-darwin-arm64": "4.0.14",
41
- "asherah-darwin-x64": "4.0.14",
42
- "asherah-linux-x64-gnu": "4.0.14",
43
- "asherah-linux-arm64-gnu": "4.0.14",
44
- "asherah-linux-x64-musl": "4.0.14",
45
- "asherah-linux-arm64-musl": "4.0.14",
46
- "asherah-windows-x64": "4.0.14",
47
- "asherah-windows-arm64": "4.0.14"
40
+ "asherah-darwin-arm64": "4.0.16",
41
+ "asherah-darwin-x64": "4.0.16",
42
+ "asherah-linux-x64-gnu": "4.0.16",
43
+ "asherah-linux-arm64-gnu": "4.0.16",
44
+ "asherah-linux-x64-musl": "4.0.16",
45
+ "asherah-linux-arm64-musl": "4.0.16",
46
+ "asherah-windows-x64": "4.0.16",
47
+ "asherah-windows-arm64": "4.0.16"
48
48
  }
49
49
  }