cf-envsync 0.3.4 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +9 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13110,7 +13110,15 @@ function decryptValue(token, password) {
13110
13110
  function decryptEnvMap(envMap, password) {
13111
13111
  const result = {};
13112
13112
  for (const [key, value] of Object.entries(envMap)) {
13113
- result[key] = isEnvsyncEncrypted(value) ? decryptValue(value, password) : value;
13113
+ if (isEnvsyncEncrypted(value)) {
13114
+ try {
13115
+ result[key] = decryptValue(value, password);
13116
+ } catch {
13117
+ throw new Error(`Failed to decrypt ${key}: wrong password or corrupted data. ` + `Check ENVSYNC_PASSWORD or .env.password`);
13118
+ }
13119
+ } else {
13120
+ result[key] = value;
13121
+ }
13114
13122
  }
13115
13123
  return result;
13116
13124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-envsync",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Sync .env files to Cloudflare Workers secrets, .dev.vars, and more",
5
5
  "type": "module",
6
6
  "exports": {