svelte-adapter-uws 0.2.4 → 0.2.6

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/index.js +4 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -119,13 +119,14 @@ export default function (opts = {}) {
119
119
  const isPublic = args.path.includes('/public');
120
120
  const isStatic = args.path.includes('/static');
121
121
  const entries = Object.entries(allEnv).filter(([k]) =>
122
- isPublic ? k.startsWith(publicPrefix) : !k.startsWith(publicPrefix)
122
+ (isPublic ? k.startsWith(publicPrefix) : !k.startsWith(publicPrefix))
123
+ && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k)
123
124
  );
124
125
  if (isStatic) {
125
126
  return { contents: entries.map(([k, v]) => `export const ${k} = ${JSON.stringify(v)};`).join('\n') || 'export {};' };
126
127
  }
127
- // dynamic: read from process.env at runtime
128
- return { contents: entries.map(([k]) => `export const ${k} = process.env[${JSON.stringify(k)}];`).join('\n') || 'export {};' };
128
+ // dynamic: re-export process.env directly
129
+ return { contents: 'export const env = process.env;' };
129
130
  });
130
131
  }
131
132
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-adapter-uws",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "SvelteKit adapter for uWebSockets.js - high-performance C++ HTTP server with built-in WebSocket support",
5
5
  "author": "Kevin Radziszewski",
6
6
  "license": "MIT",